summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-09-16 08:19:27 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-09-16 10:56:48 -0300
commit0435028d180cdabe89c464a2272adacdde3fe39d (patch)
tree48eab1812b812435e98f62e4f373b900f0431740
parent82724f90b007a1589eacd0fe6d3c33e1b5b3b8f7 (diff)
downloadgitlab-ce-0435028d180cdabe89c464a2272adacdde3fe39d.tar.gz
Show/hide label type icon when set/removing label priority
-rw-r--r--app/helpers/labels_helper.rb8
-rw-r--r--app/views/projects/labels/index.html.haml2
-rw-r--r--app/views/shared/_label_row.html.haml3
3 files changed, 7 insertions, 6 deletions
diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb
index b344f11ca11..10f05c358b3 100644
--- a/app/helpers/labels_helper.rb
+++ b/app/helpers/labels_helper.rb
@@ -60,7 +60,7 @@ module LabelsHelper
end
end
- def label_type_icon(label)
+ def label_type_icon(label, options = {})
name =
case label.label_type.to_sym
when :global_label then 'globe'
@@ -68,12 +68,14 @@ module LabelsHelper
when :project_label then 'bookmark'
end
+ options[:class].to_s << ' has-tooltip js-label-type'
+
content_tag :span,
- class: 'has-tooltip',
+ class: options[:class],
data: { 'placement' => 'top' },
title: label.label_type.titleize,
aria: { label: label.label_type.titleize } do
- icon(name, base: true, class: 'label-type')
+ icon(name, base: true)
end
end
diff --git a/app/views/projects/labels/index.html.haml b/app/views/projects/labels/index.html.haml
index 344405be462..6d6ef0bbc70 100644
--- a/app/views/projects/labels/index.html.haml
+++ b/app/views/projects/labels/index.html.haml
@@ -33,7 +33,7 @@
- if @global_labels.present?
= render @global_labels
- .group-labels{ class: ('hide' if hide) }
+ .group-labels{ class: ('hide' if hide || @project.group.blank?) }
%h5
= icon('folder-open')
Group Labels
diff --git a/app/views/shared/_label_row.html.haml b/app/views/shared/_label_row.html.haml
index 71c1cd145fb..1a4b5961510 100644
--- a/app/views/shared/_label_row.html.haml
+++ b/app/views/shared/_label_row.html.haml
@@ -10,8 +10,7 @@
= icon('star')
%span.label-name
= link_to_label(label, tooltip: false)
- - if label.priority.present?
- = label_type_icon(label)
+ = label_type_icon(label, class: "#{'hidden' if label.priority.blank?}" )
- if label.description
%span.label-description
= markdown(label.description, pipeline: :single_line)