index.html.haml 1.96 KB
Newer Older
1
- @no_container = true
2
- page_title "Labels"
3
- hide_class = ''
4
- can_admin_label = can?(current_user, :admin_label, @project)
5 6 7 8 9

- if show_new_nav? && can?(current_user, :admin_label, @project)
  - content_for :breadcrumbs_extra do
    = link_to "New label", new_namespace_project_label_path(@project.namespace, @project), class: "btn btn-new"

10
= render "shared/mr_head"
11

12 13 14 15
- if @labels.exists? || @prioritized_labels.exists?
  %div{ class: container_class }
    .top-area.adjust
      .nav-text
16 17 18
        Labels can be applied to issues and merge requests.
        - if can_admin_label
          Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.
19

20 21
      - if can_admin_label
        .nav-controls{ class: ("visible-xs" if show_new_nav?) }
22
          = link_to new_project_label_path(@project), class: "btn btn-new" do
23
            New label
24

25
    .labels
26
      - if can_admin_label
27 28 29 30
        -# Only show it in the first page
        - hide = @available_labels.empty? || (params[:page].present? && params[:page] != '1')
        .prioritized-labels{ class: ('hide' if hide) }
          %h5 Prioritized Labels
31
          %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_project_labels_path(@project) }
32 33 34 35 36 37 38
            #js-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

      - if @labels.present?
        .other-labels
39
          - if can_admin_label
40 41 42 43 44 45
            %h5{ class: ('hide' if hide) } Other Labels
          %ul.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'