BigW Consortium Gitlab

index.html.haml 1.87 KB
Newer Older
1
- @no_container = true
2
- page_title "Labels"
3
- hide_class = ''
4
= render "projects/issues/head"
5

6 7 8
- content_for :page_specific_javascripts do
  = page_specific_javascript_bundle_tag('simulate_drag') if Rails.env.test?

9 10 11 12 13
- 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.
14

15 16 17 18
      .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
19

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