summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2018-02-22 09:17:49 -0600
committerEric Eastwood <contact@ericeastwood.com>2018-02-22 09:17:49 -0600
commit21c16b900be62bb7074753517bacf5b59f971d2c (patch)
tree6a4704f518ad8da2be5653cc2136a84935c751f1 /app
parent65da44b25e5af7c8535fa4165e75e22e8b500b52 (diff)
downloadgitlab-ce-21c16b900be62bb7074753517bacf5b59f971d2c.tar.gz
Remove indent and reduce bloat with link_to_if
See - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16900#note_60163789 - https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/16900#note_60164324
Diffstat (limited to 'app')
-rw-r--r--app/views/projects/_stat_anchor_list.html.haml16
1 files changed, 6 insertions, 10 deletions
diff --git a/app/views/projects/_stat_anchor_list.html.haml b/app/views/projects/_stat_anchor_list.html.haml
index 055d484cf49..a115b65938b 100644
--- a/app/views/projects/_stat_anchor_list.html.haml
+++ b/app/views/projects/_stat_anchor_list.html.haml
@@ -1,12 +1,8 @@
- anchors = local_assigns.fetch(:anchors, [])
-- if anchors.size > 0
- %ul.nav
- - anchors.each do |anchor|
- %li
- - if anchor.link
- = link_to anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
- = anchor.label
- - else
- %span.stat-text
- = anchor.label
+- return unless anchors.any?
+%ul.nav
+ - anchors.each do |anchor|
+ %li
+ = link_to_if anchor.link, anchor.label, anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
+ %span.stat-text= anchor.label