summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bennett <lukeeeebennettplus@gmail.com>2018-04-19 01:20:38 +0100
committerLuke Bennett <lukeeeebennettplus@gmail.com>2018-04-19 01:20:38 +0100
commit8b4e1d0ccd6c2624ac230597c4e63c8b51bc76ba (patch)
tree85f411958ccd6a912bd9d666ce144b33d5067ebc
parentc9f23ffe5bb4cc5bf28e28e7736d867ec0de5443 (diff)
downloadgitlab-ce-8b4e1d0ccd6c2624ac230597c4e63c8b51bc76ba.tar.gz
Add/use Label#priority? and remove weird padding
-rw-r--r--app/assets/stylesheets/pages/labels.scss4
-rw-r--r--app/models/label.rb4
-rw-r--r--app/views/shared/_label.html.haml2
-rw-r--r--app/views/shared/_label_row.html.haml2
4 files changed, 8 insertions, 4 deletions
diff --git a/app/assets/stylesheets/pages/labels.scss b/app/assets/stylesheets/pages/labels.scss
index c84c1594986..85740b91ba6 100644
--- a/app/assets/stylesheets/pages/labels.scss
+++ b/app/assets/stylesheets/pages/labels.scss
@@ -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;
}
diff --git a/app/models/label.rb b/app/models/label.rb
index f3496884cff..12e8c5695d4 100644
--- a/app/models/label.rb
+++ b/app/models/label.rb
@@ -137,6 +137,10 @@ class Label < ActiveRecord::Base
priority.try(:priority)
end
+ def priority?
+ priorities.present?
+ end
+
def template?
template
end
diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml
index 8302918ebc9..3d7cad8ecf8 100644
--- a/app/views/shared/_label.html.haml
+++ b/app/views/shared/_label.html.haml
@@ -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
diff --git a/app/views/shared/_label_row.html.haml b/app/views/shared/_label_row.html.haml
index a2997bb9146..c098c916915 100644
--- a/app/views/shared/_label_row.html.haml
+++ b/app/views/shared/_label_row.html.haml
@@ -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 \ No newline at end of file