2016-06-10 09:17:28 -04:00
- @no_container = true
2015-04-30 13:06:18 -04:00
- page_title "Labels"
2016-06-03 02:36:09 -04:00
- hide_class = ''
2017-04-13 03:55:15 -04:00
= render "shared/mr_head"
2015-09-14 14:08:35 -04:00
2016-11-12 18:51:47 -05:00
- if @labels.exists? || @prioritized_labels.exists?
%div{ class: container_class }
.top-area.adjust
.nav-text
Labels can be applied to issues and merge requests. Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.
2016-06-14 12:48:42 -04:00
2016-11-12 18:51:47 -05:00
.nav-controls
- if can?(current_user, :admin_label, @project)
= link_to new_namespace_project_label_path(@project.namespace, @project), class: "btn btn-new" do
New label
2016-09-19 23:09:57 -04:00
2016-11-12 18:51:47 -05:00
.labels
2016-09-29 00:03:28 -04:00
- if can?(current_user, :admin_label, @project)
2016-11-12 18:51:47 -05:00
-# Only show it in the first page
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
.prioritized-labels{ class: ('hide' if hide) }
%h5 Prioritized Labels
%ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) }
#js-priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty?}" }
= render 'shared/empty_states/priority_labels'
- if @prioritized_labels.present?
= render partial: 'shared/label', subject: @project, collection: @prioritized_labels, as: :label
- if @labels.present?
.other-labels
2016-09-29 00:03:28 -04:00
- if can?(current_user, :admin_label, @project)
2016-11-12 18:51:47 -05:00
%h5{ class: ('hide' if hide) } Other Labels
%ul.content-list.manage-labels-list.js-other-labels
= render partial: 'shared/label', subject: @project, collection: @labels, as: :label
= paginate @labels, theme: 'gitlab'
- else
= render 'shared/empty_states/labels'