gitlab-org--gitlab-foss/app/views/projects/labels/index.html.haml

45 lines
2.0 KiB
Plaintext
Raw Normal View History

- @no_container = true
2015-04-30 17:06:18 +00:00
- page_title "Labels"
- 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
- if @labels.exists? || @prioritized_labels.exists?
#promote-label-modal
%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.')
- 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
- if can_admin_label
-# Only show it in the first page
- hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
.prioritized-labels{ class: ('hide' if hide) }
%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?}" }
= render 'shared/empty_states/priority_labels'
- if @prioritized_labels.present?
= render partial: 'shared/label', subject: @project, collection: @prioritized_labels, as: :label, locals: { force_priority: true }
- if @labels.present?
.other-labels
- 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
= 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')