summaryrefslogtreecommitdiff
path: root/app/views/shared/_label_row.html.haml
blob: f1c1ca9b2c92dfb4f4811cb6c0c4e00f994eed82 (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
- subject = local_assigns[:subject]
- show_label_issues_link = show_label_issuables_link?(label, :issues, project: @project)
- show_label_merge_requests_link = show_label_issuables_link?(label, :merge_requests, project: @project)

%span.label-row
  - if can?(current_user, :admin_label, @project)
    .draggable-handler
      = icon('bars')
    .js-toggle-priority.toggle-priority{ data: { url: remove_priority_project_label_path(@project, label),
      dom_id: dom_id(label), type: label.type } }
      %button.add-priority.btn.has-tooltip{ title: 'Prioritize', type: 'button', :'data-placement' => 'top' }
        = icon('star-o')
      %button.remove-priority.btn.has-tooltip{ title: 'Remove priority', type: 'button', :'data-placement' => 'top' }
        = icon('star')
  %span.label-name
    = link_to_label(label, subject: @project, tooltip: false)
  - if defined?(@project) && @project.group.present?
    %span.label-type
      = label.model_name.human.titleize

  %span.label-description
    - if label.description.present?
      .description-text
        = markdown_field(label, :description)
    .d-none.d-sm-none.d-md-block
      - if show_label_issues_link
        = link_to_label(label, subject: subject) { 'Issues' }
      - if show_label_merge_requests_link
        ·
        = link_to_label(label, subject: subject, type: :merge_request) { 'Merge requests' }