summaryrefslogtreecommitdiff
path: root/app/views/projects/labels/index.html.haml
blob: 8e6f84fc430a53fbcaab6a4139677e1b8d1c4f2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
- @no_container = true
- page_title "Labels"
- hide_class = ''
= render "projects/issues/head"

%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.

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

  .labels
    - unless @labels.empty?
      -# Only show it in the first page
      - hide = params[:page].present? && params[:page] != '1'
      - if can?(current_user, :admin_label, @project)
        .prioritized-labels{ class: ('hide' if hide) }
          %h5 Prioritized Labels
          %ul.content-list.manage-labels-list.js-prioritized-labels{ "data-url" => set_priorities_namespace_project_labels_path(@project.namespace, @project) }
            %p.empty-message{ class: ('hidden' unless @prioritized_labels.empty?) } No prioritized labels yet
            - if @prioritized_labels.present?
              = render partial: 'shared/label', collection: @prioritized_labels, as: :label

      .group-labels{ class: ('hide' if hide || @project.group.blank?) }
        %h5
          = icon('folder-open')
          Group Labels
        %ul.content-list.manage-labels-list.js-group-labels
          %p.empty-message{ class: ('hidden' unless @group_labels.empty?) } No group labels
          - if @group_labels.present?
            = render partial: 'shared/label', collection: @group_labels, as: :label

      .project-labels
        %h5{ class: ('hide' if hide) }
          = icon('bookmark')
          Project Labels
        %ul.content-list.manage-labels-list.js-project-labels
          %p.empty-message{ class: ('hidden' unless @project_labels.empty?) } No project labels
          - if @project_labels.present?
            = render partial: 'shared/label', collection: @project_labels, as: :label
            = paginate @project_labels, theme: 'gitlab'
    - else
      .nothing-here-block
        - if can?(current_user, :admin_label, @project)
          Create a label or #{link_to 'generate a default set of labels', generate_namespace_project_labels_path(@project.namespace, @project), method: :post}.
        - else
          No labels created yet.