Add/use Label#priority? and remove weird padding

This commit is contained in:
Luke Bennett 2018-04-19 01:20:38 +01:00
parent c9f23ffe5b
commit 8b4e1d0ccd
No known key found for this signature in database
GPG key ID: A738E9C68D3BF31A
4 changed files with 8 additions and 4 deletions

View file

@ -81,7 +81,7 @@
display: block;
.description-text {
margin: 0 $gl-padding 10px 0;
margin: 0 0 10px 0;
}
a {
@ -309,7 +309,7 @@
.label-links {
list-style: none;
padding: 0 $gl-padding 0 0;
padding: 0;
white-space: nowrap;
}

View file

@ -137,6 +137,10 @@ class Label < ActiveRecord::Base
priority.try(:priority)
end
def priority?
priorities.present?
end
def template?
template
end

View file

@ -5,7 +5,7 @@
- show_label_merge_requests_link = show_label_issuables_link?(label, :merge_requests, project: @project)
- show_label_issues_link = show_label_issuables_link?(label, :issues, project: @project)
%li.label-list-item{ class: label.priorities.present? ? '' : 'no-hand', id: label_css_id, data: { id: label.id } }
%li.label-list-item{ class: label.priority? ? '' : 'no-hand', id: label_css_id, data: { id: label.id } }
= render "shared/label_row", label: label
%ul.label-actions-list
%li.inline

View file

@ -17,6 +17,6 @@
&middot;
%li.label-link-item.inline
= link_to_label(label, subject: subject, type: :merge_request) { 'Merge requests' }
- if label.priorities.present?
- if label.priority?
%li.label-link-item.inline.prepend-left-10
.label-badge.label-badge-blue Prioritized label