index.html.haml 1.69 KB
Newer Older
1
- @no_container = true
2
- page_title "Labels"
3
- hide_class = ''
4
= render "shared/mr_head"
5

6 7 8 9 10
- if @labels.exists? || @prioritized_labels.exists?
  %div{ class: container_class }
    .top-area.adjust
      .nav-text
        Labels can be applied to issues and merge requests. Star a label to make it a priority label. Order the prioritized labels to change their relative priority, by dragging.
11

12 13
      .nav-controls
        - if can?(current_user, :admin_label, @project)
14
          = link_to new_project_label_path(@project), class: "btn btn-new" do
15
            New label
16

17
    .labels
18
      - if can?(current_user, :admin_label, @project)
19 20 21 22
        -# 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
23
          %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_project_labels_path(@project) }
24 25 26 27 28 29 30
            #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
31
          - if can?(current_user, :admin_label, @project)
32 33 34 35 36 37
            %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'