2016-06-10 13:17:28 +00:00
|
|
|
- @no_container = true
|
2015-04-30 17:06:18 +00:00
|
|
|
- page_title "Labels"
|
2017-07-17 11:41:50 +00:00
|
|
|
- can_admin_label = can?(current_user, :admin_label, @project)
|
2018-04-19 02:09:20 +00:00
|
|
|
- hide_class = ''
|
|
|
|
|
|
|
|
- if can_admin_label
|
|
|
|
- content_for(:header_content) do
|
|
|
|
.nav-controls
|
2018-06-05 09:47:43 +00:00
|
|
|
= link_to _('New label'), new_project_label_path(@project), class: "btn btn-new"
|
2018-04-19 02:09:20 +00:00
|
|
|
|
2016-11-12 23:51:47 +00:00
|
|
|
- if @labels.exists? || @prioritized_labels.exists?
|
2018-02-20 19:43:37 +00:00
|
|
|
#promote-label-modal
|
2016-11-12 23:51:47 +00:00
|
|
|
%div{ class: container_class }
|
|
|
|
.top-area.adjust
|
|
|
|
.nav-text
|
2018-06-05 09:47:43 +00:00
|
|
|
= _('Labels can be applied to issues and merge requests.')
|
2017-07-17 11:41:50 +00:00
|
|
|
- if can_admin_label
|
2018-06-05 09:47:43 +00:00
|
|
|
= _('Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.')
|
2016-06-14 16:48:42 +00:00
|
|
|
|
2018-04-18 17:48:19 +00:00
|
|
|
.labels-container.prepend-top-5
|
2017-07-17 11:41:50 +00:00
|
|
|
- if can_admin_label
|
2016-11-12 23:51:47 +00:00
|
|
|
-# Only show it in the first page
|
|
|
|
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
|
|
|
|
.prioritized-labels{ class: ('hide' if hide) }
|
2018-06-05 10:55:32 +00:00
|
|
|
%h5.prepend-top-10= _('Prioritized Labels')
|
2018-05-17 02:00:35 +00:00
|
|
|
.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_project_labels_path(@project) }
|
2018-05-08 19:53:40 +00:00
|
|
|
#js-priority-labels-empty-state.priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty?}" }
|
2016-11-12 23:51:47 +00:00
|
|
|
= render 'shared/empty_states/priority_labels'
|
|
|
|
- if @prioritized_labels.present?
|
2018-05-24 12:29:00 +00:00
|
|
|
= render partial: 'shared/label', subject: @project, collection: @prioritized_labels, as: :label, locals: { force_priority: true }
|
2016-11-12 23:51:47 +00:00
|
|
|
|
|
|
|
- if @labels.present?
|
|
|
|
.other-labels
|
2017-07-17 11:41:50 +00:00
|
|
|
- if can_admin_label
|
2018-06-05 09:47:43 +00:00
|
|
|
%h5{ class: ('hide' if hide) }= _('Other Labels')
|
2018-05-17 02:00:35 +00:00
|
|
|
.content-list.manage-labels-list.js-other-labels
|
2016-11-12 23:51:47 +00:00
|
|
|
= render partial: 'shared/label', subject: @project, collection: @labels, as: :label
|
|
|
|
= paginate @labels, theme: 'gitlab'
|
|
|
|
- else
|
|
|
|
= render 'shared/empty_states/labels'
|
2018-04-19 02:19:55 +00:00
|
|
|
|
|
|
|
%template#js-badge-item-template
|
|
|
|
%li.label-link-item.js-priority-badge.inline.prepend-left-10
|
2018-06-05 09:47:43 +00:00
|
|
|
.label-badge.label-badge-blue= _('Prioritized label')
|