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
This commit is contained in:
parent
65da44b25e
commit
21c16b900b
1 changed files with 6 additions and 10 deletions
|
@ -1,12 +1,8 @@
|
||||||
- anchors = local_assigns.fetch(:anchors, [])
|
- anchors = local_assigns.fetch(:anchors, [])
|
||||||
|
|
||||||
- if anchors.size > 0
|
- return unless anchors.any?
|
||||||
%ul.nav
|
%ul.nav
|
||||||
- anchors.each do |anchor|
|
- anchors.each do |anchor|
|
||||||
%li
|
%li
|
||||||
- if anchor.link
|
= link_to_if anchor.link, anchor.label, anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
|
||||||
= link_to anchor.link, class: anchor.enabled ? 'stat-link' : "btn btn-#{anchor.class_modifier || 'missing'}" do
|
%span.stat-text= anchor.label
|
||||||
= anchor.label
|
|
||||||
- else
|
|
||||||
%span.stat-text
|
|
||||||
= anchor.label
|
|
||||||
|
|
Loading…
Reference in a new issue