2020-07-28 23:09:34 +05:30
|
|
|
- page_title _("Labels")
|
2017-09-10 17:25:29 +05:30
|
|
|
- can_admin_label = can?(current_user, :admin_label, @project)
|
2018-11-18 11:00:15 +05:30
|
|
|
- search = params[:search]
|
2018-12-05 23:21:45 +05:30
|
|
|
- subscribed = params[:subscribed]
|
|
|
|
- labels_or_filters = @labels.exists? || @prioritized_labels.exists? || search.present? || subscribed.present?
|
2018-11-08 19:23:39 +05:30
|
|
|
|
2018-12-05 23:21:45 +05:30
|
|
|
- if labels_or_filters
|
2021-01-29 00:20:46 +05:30
|
|
|
#js-promote-label-modal
|
2019-12-04 20:38:33 +05:30
|
|
|
= render 'shared/labels/nav', labels_or_filters: labels_or_filters, can_admin_label: can_admin_label
|
2018-11-18 11:00:15 +05:30
|
|
|
|
2021-04-29 21:17:54 +05:30
|
|
|
.labels-container.gl-mt-3.gl-bg-gray-10.gl-border-solid.gl-border-1.gl-border-gray-100
|
2019-12-04 20:38:33 +05:30
|
|
|
- if can_admin_label && search.blank?
|
|
|
|
%p.text-muted
|
|
|
|
= _('Labels can be applied to issues and merge requests.')
|
|
|
|
%br
|
|
|
|
= _('Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.')
|
2019-07-31 22:56:46 +05:30
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
-# Only show it in the first page
|
|
|
|
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
|
2021-01-29 00:20:46 +05:30
|
|
|
.prioritized-labels.gl-mb-7{ class: [('hide' if hide), ('is-not-draggable' unless can_admin_label)] }
|
2020-10-24 23:57:45 +05:30
|
|
|
%h5.gl-mt-3= _('Prioritized Labels')
|
2019-12-04 20:38:33 +05:30
|
|
|
.content-list.manage-labels-list.js-prioritized-labels{ data: { url: set_priorities_project_labels_path(@project), sortable: can_admin_label } }
|
|
|
|
#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-24 23:13:21 +05:30
|
|
|
- if @prioritized_labels.any?
|
2019-12-04 20:38:33 +05:30
|
|
|
= render partial: 'shared/label', collection: @prioritized_labels, as: :label, locals: { force_priority: true, subject: @project }
|
|
|
|
- elsif search.present?
|
|
|
|
.nothing-here-block
|
2019-12-26 22:10:19 +05:30
|
|
|
= _('No prioritized labels with such name or description')
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
- if @labels.any?
|
2019-12-04 20:38:33 +05:30
|
|
|
.other-labels
|
|
|
|
%h5{ class: ('hide' if hide) }= _('Other Labels')
|
|
|
|
.content-list.manage-labels-list.js-other-labels
|
|
|
|
= render partial: 'shared/label', collection: @labels, as: :label, locals: { subject: @project }
|
|
|
|
= paginate @labels, theme: 'gitlab'
|
|
|
|
- elsif search.present?
|
|
|
|
.other-labels
|
|
|
|
- if @available_labels.any?
|
|
|
|
%h5
|
|
|
|
= _('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-11-18 11:00:15 +05:30
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
- else
|
|
|
|
= render 'shared/empty_states/labels'
|
2018-11-08 19:23:39 +05:30
|
|
|
|
|
|
|
%template#js-badge-item-template
|
2021-01-03 14:25:43 +05:30
|
|
|
%li.js-priority-badge.inline.gl-ml-3
|
|
|
|
.label-badge.gl-bg-blue-50= _('Prioritized label')
|