debian-mirror-gitlab/app/views/projects/labels/index.html.haml

65 lines
2.8 KiB
Text
Raw Normal View History

- @no_container = true
2015-09-11 14:41:01 +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
2019-02-15 15:39:39 +05:30
- if labels_or_filters && can_admin_label
2018-11-08 19:23:39 +05:30
- content_for(:header_content) do
.nav-controls
2018-12-13 13:39:08 +05:30
= link_to _('New label'), new_project_label_path(@project), class: "btn btn-success qa-label-create-new"
2017-09-10 17:25:29 +05:30
2018-12-05 23:21:45 +05:30
- if labels_or_filters
2018-03-27 19:54:05 +05:30
#promote-label-modal
2017-08-17 22:00:37 +05:30
%div{ class: container_class }
2018-12-05 23:21:45 +05:30
= render 'shared/labels/nav'
2018-11-18 11:00:15 +05:30
.labels-container.prepend-top-10
2017-09-10 17:25:29 +05:30
- if can_admin_label
2018-11-18 11:00:15 +05:30
- if search.blank?
%p.text-muted
2018-12-05 23:21:45 +05:30
= _('Labels can be applied to issues and merge requests.')
%br
2018-11-18 11:00:15 +05:30
= _('Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.')
2017-08-17 22:00:37 +05:30
-# Only show it in the first page
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
.prioritized-labels{ class: ('hide' if hide) }
2018-11-08 19:23:39 +05:30
%h5.prepend-top-10= _('Prioritized Labels')
.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_project_labels_path(@project) }
2018-11-18 11:00:15 +05:30
#js-priority-labels-empty-state.priority-labels-empty-state{ class: "#{'hidden' unless @prioritized_labels.empty? && search.blank?}" }
2017-08-17 22:00:37 +05:30
= render 'shared/empty_states/priority_labels'
- if @prioritized_labels.present?
2018-11-08 19:23:39 +05:30
= render partial: 'shared/label', subject: @project, collection: @prioritized_labels, as: :label, locals: { force_priority: true }
2018-11-18 11:00:15 +05:30
- elsif search.present?
.nothing-here-block
= _('No prioritised labels with such name or description')
2017-08-17 22:00:37 +05:30
- if @labels.present?
.other-labels
2017-09-10 17:25:29 +05:30
- if can_admin_label
2018-11-08 19:23:39 +05:30
%h5{ class: ('hide' if hide) }= _('Other Labels')
.content-list.manage-labels-list.js-other-labels
2017-08-17 22:00:37 +05:30
= render partial: 'shared/label', subject: @project, collection: @labels, as: :label
= paginate @labels, theme: 'gitlab'
2018-11-18 11:00:15 +05:30
- 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')
2018-12-05 23:21:45 +05:30
- 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
%li.label-link-item.js-priority-badge.inline.prepend-left-10
.label-badge.label-badge-blue= _('Prioritized label')