2015-04-30 13:06:18 -04:00
|
|
|
- page_title "Labels"
|
2017-07-17 07:41:50 -04:00
|
|
|
- can_admin_label = can?(current_user, :admin_label, @project)
|
2018-07-28 07:15:30 -04:00
|
|
|
- search = params[:search]
|
2018-09-27 10:19:28 -04:00
|
|
|
- subscribed = params[:subscribed]
|
|
|
|
- labels_or_filters = @labels.exists? || @prioritized_labels.exists? || search.present? || subscribed.present?
|
2018-04-18 22:09:20 -04:00
|
|
|
|
2018-09-27 10:19:28 -04:00
|
|
|
- if labels_or_filters
|
2018-02-20 14:43:37 -05:00
|
|
|
#promote-label-modal
|
2019-09-03 05:03:35 -04:00
|
|
|
= render 'shared/labels/nav', labels_or_filters: labels_or_filters, can_admin_label: can_admin_label
|
2018-07-20 10:28:45 -04:00
|
|
|
|
2019-09-03 05:03:35 -04:00
|
|
|
.labels-container.prepend-top-10
|
|
|
|
- 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-04-12 06:54:23 -04:00
|
|
|
|
2019-09-03 05:03:35 -04:00
|
|
|
-# Only show it in the first page
|
|
|
|
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
|
|
|
|
.prioritized-labels{ class: [('hide' if hide), ('is-not-draggable' unless can_admin_label)] }
|
|
|
|
%h5.prepend-top-10= _('Prioritized Labels')
|
|
|
|
.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'
|
|
|
|
- if @prioritized_labels.present?
|
|
|
|
= render partial: 'shared/label', collection: @prioritized_labels, as: :label, locals: { force_priority: true, subject: @project }
|
|
|
|
- elsif search.present?
|
|
|
|
.nothing-here-block
|
2019-11-08 07:06:32 -05:00
|
|
|
= _('No prioritized labels with such name or description')
|
2016-11-12 18:51:47 -05:00
|
|
|
|
2019-09-03 05:03:35 -04:00
|
|
|
- if @labels.present?
|
|
|
|
.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-07-27 11:37:46 -04:00
|
|
|
|
2016-11-12 18:51:47 -05:00
|
|
|
- else
|
|
|
|
= render 'shared/empty_states/labels'
|
2018-04-18 22:19:55 -04:00
|
|
|
|
|
|
|
%template#js-badge-item-template
|
|
|
|
%li.label-link-item.js-priority-badge.inline.prepend-left-10
|
2018-06-05 05:47:43 -04:00
|
|
|
.label-badge.label-badge-blue= _('Prioritized label')
|