_issuable.html.haml 1.6 KB
Newer Older
R
Rubén Dávila 已提交
1 2 3 4 5
-# @project is present when viewing Project's milestone
- project = @project || issuable.project
- assignee = issuable.assignee
- issuable_type = issuable.class.table_name
- base_url_args = [project.namespace.becomes(Namespace), project, issuable_type]
6
- can_update = can?(current_user, :"update_#{issuable.to_ability_name}", issuable)
R
Rubén Dávila 已提交
7

P
Phil Hughes 已提交
8
%li{ id: dom_id(issuable, 'sortable'),  class: "issuable-row #{'is-disabled' unless can_update}", 'data-iid' => issuable.iid, 'data-id' => issuable.id, 'data-url' => polymorphic_path(issuable) }
R
Rubén Dávila 已提交
9 10 11 12 13
  %span
    - if show_project_name
      %strong #{project.name} ·
    - elsif show_full_project_name
      %strong #{project.name_with_namespace} ·
14 15
    - if issuable.is_a?(Issue)
      = confidential_icon(issuable)
R
Rubén Dávila 已提交
16
    = link_to_gfm issuable.title, [project.namespace.becomes(Namespace), project, issuable], title: issuable.title
17
  .issuable-detail
R
Rubén Dávila 已提交
18
    = link_to [project.namespace.becomes(Namespace), project, issuable] do
19
      %span.issuable-number= issuable.to_reference
R
Rubén Dávila 已提交
20 21 22 23 24

    - issuable.labels.each do |label|
      = link_to polymorphic_path(base_url_args, { milestone_title: @milestone.title, label_name: label.title, state: 'all' }) do
        - render_colored_label(label)

25
    %span.assignee-icon
26 27 28 29
      - if assignee
        = link_to polymorphic_path(base_url_args, { milestone_title: @milestone.title, assignee_id: issuable.assignee_id, state: 'all' }),
                  class: 'has-tooltip', title: "Assigned to #{assignee.name}", data: { container: 'body' } do
          - image_tag(avatar_icon(issuable.assignee, 16), class: "avatar s16", alt: '')