2020-06-22 12:08:47 +00:00
|
|
|
- page_title _("Labels")
|
2017-07-17 11:41:50 +00:00
|
|
|
- can_admin_label = can?(current_user, :admin_label, @project)
|
2018-07-28 11:15:30 +00:00
|
|
|
- search = params[:search]
|
2018-09-27 14:19:28 +00:00
|
|
|
- subscribed = params[:subscribed]
|
|
|
|
- labels_or_filters = @labels.exists? || @prioritized_labels.exists? || search.present? || subscribed.present?
|
2018-04-19 02:09:20 +00:00
|
|
|
|
2018-09-27 14:19:28 +00:00
|
|
|
- if labels_or_filters
|
2020-10-27 12:08:33 +00:00
|
|
|
#js-promote-label-modal
|
2019-09-03 09:03:35 +00:00
|
|
|
= render 'shared/labels/nav', labels_or_filters: labels_or_filters, can_admin_label: can_admin_label
|
2018-07-20 14:28:45 +00:00
|
|
|
|
2022-06-06 12:08:32 +00:00
|
|
|
.labels-container.gl-mt-5
|
2019-09-03 09:03:35 +00:00
|
|
|
- if can_admin_label && search.blank?
|
|
|
|
%p.text-muted
|
2022-08-17 18:11:29 +00:00
|
|
|
= _('Labels can be applied to issues and merge requests. Star a label to make it a priority label.')
|
2019-04-12 10:54:23 +00:00
|
|
|
|
2019-09-03 09:03:35 +00:00
|
|
|
-# Only show it in the first page
|
|
|
|
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
|
2020-10-27 03:09:02 +00:00
|
|
|
.prioritized-labels.gl-mb-7{ class: [('hide' if hide), ('is-not-draggable' unless can_admin_label)] }
|
2022-06-06 12:08:32 +00:00
|
|
|
%h4.gl-mt-3= _('Prioritized Labels')
|
2022-08-17 18:11:29 +00:00
|
|
|
%p.text-muted
|
|
|
|
= _('Drag to reorder prioritized labels and change their relative priority.')
|
2022-06-06 12:08:32 +00:00
|
|
|
.manage-labels-list.js-prioritized-labels{ data: { url: set_priorities_project_labels_path(@project), sortable: can_admin_label } }
|
2019-09-03 09:03:35 +00:00
|
|
|
#js-priority-labels-empty-state.priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty? && search.blank?}" }
|
|
|
|
= render 'shared/empty_states/priority_labels'
|
2020-05-14 03:07:52 +00:00
|
|
|
- if @prioritized_labels.any?
|
2019-09-03 09:03:35 +00:00
|
|
|
= render partial: 'shared/label', collection: @prioritized_labels, as: :label, locals: { force_priority: true, subject: @project }
|
|
|
|
- elsif search.present?
|
|
|
|
.nothing-here-block
|
2019-11-08 12:06:32 +00:00
|
|
|
= _('No prioritized labels with such name or description')
|
2016-11-12 23:51:47 +00:00
|
|
|
|
2020-05-14 03:07:52 +00:00
|
|
|
- if @labels.any?
|
2019-09-03 09:03:35 +00:00
|
|
|
.other-labels
|
2022-06-06 12:08:32 +00:00
|
|
|
%h4{ class: ('hide' if hide) }= _('Other Labels')
|
|
|
|
.manage-labels-list.js-other-labels
|
2019-09-03 09:03:35 +00:00
|
|
|
= render partial: 'shared/label', collection: @labels, as: :label, locals: { subject: @project }
|
|
|
|
= paginate @labels, theme: 'gitlab'
|
|
|
|
- elsif search.present?
|
|
|
|
.other-labels
|
|
|
|
- if @available_labels.any?
|
2022-06-06 12:08:32 +00:00
|
|
|
%h4
|
2019-09-03 09:03:35 +00:00
|
|
|
= _('Other Labels')
|
|
|
|
.nothing-here-block
|
|
|
|
= _('No other labels with such name or description')
|
|
|
|
- else
|
|
|
|
.nothing-here-block
|
|
|
|
= _('No labels with such name or description')
|
|
|
|
- elsif subscribed.present?
|
|
|
|
.nothing-here-block
|
|
|
|
= _('You do not have any subscriptions yet')
|
2018-07-27 15:37:46 +00:00
|
|
|
|
2016-11-12 23:51:47 +00:00
|
|
|
- else
|
|
|
|
= render 'shared/empty_states/labels'
|
2018-04-19 02:19:55 +00:00
|
|
|
|
|
|
|
%template#js-badge-item-template
|
2020-10-01 03:09:55 +00:00
|
|
|
%li.js-priority-badge.inline.gl-ml-3
|
|
|
|
.label-badge.gl-bg-blue-50= _('Prioritized label')
|