show.html.haml 5.43 KB
Newer Older
1
- @content_class = "limit-container-width" unless fluid_layout
2 3
- add_to_breadcrumbs "Issues", project_issues_path(@project)
- breadcrumb_title @issue.to_reference
4
- page_title           "#{@issue.title} (#{@issue.to_reference})", "Issues"
5
- page_description     @issue.description
6
- page_card_attributes @issue.card_attributes
Douwe Maan's avatar
Douwe Maan committed
7

8
- can_update_issue = can?(current_user, :update_issue, @issue)
9
- can_reopen_issue = can?(current_user, :reopen_issue, @issue)
10
- can_report_spam = @issue.submittable_as_spam_by?(current_user)
11
- can_create_issue = show_new_issue_link?(@project)
12

13 14
.detail-page-header
  .detail-page-header-body
Eric Eastwood's avatar
Eric Eastwood committed
15
    .issuable-status-box.status-box.status-box-issue-closed{ class: issue_button_visibility(@issue, false) }
Clement Ho's avatar
Clement Ho committed
16
      = sprite_icon('mobile-issue-close', size: 16, css_class: 'd-block d-sm-none')
17
      .d-none.d-sm-block
18
        - if @issue.moved? && can?(current_user, :read_issue, @issue.moved_to)
19
          - moved_link_start = "<a href=\"#{issue_path(@issue.moved_to)}\" class=\"text-white text-underline\">".html_safe
20 21 22
          - moved_link_end = '</a>'.html_safe
          = s_('IssuableStatus|Closed (%{moved_link_start}moved%{moved_link_end})').html_safe % {moved_link_start: moved_link_start,
            moved_link_end: moved_link_end}
23 24
        - else
          = _("Closed")
Phil Hughes's avatar
Phil Hughes committed
25
    .issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) }
Clement Ho's avatar
Clement Ho committed
26
      = sprite_icon('issue-open-m', size: 16, css_class: 'd-block d-sm-none')
Clement Ho's avatar
Clement Ho committed
27
      %span.d-none.d-sm-block Open
28

29
    .issuable-meta
30
      - if @issue.confidential
31
        .issuable-warning-icon.inline= sprite_icon('eye-slash', size: 16, css_class: 'icon')
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett committed
32
      - if @issue.discussion_locked?
33
        .issuable-warning-icon.inline= sprite_icon('lock', size: 16, css_class: 'icon')
Luke "Jared" Bennett's avatar
Luke "Jared" Bennett committed
34
      = issuable_meta(@issue, @project, "Issue")
35

36
    %a.btn.btn-default.float-right.d-block.d-sm-none.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" }
37 38 39
      = icon('angle-double-left')

  .detail-page-header-actions.js-issuable-actions
40
    .clearfix.issue-btn-group.dropdown
41
      %button.btn.btn-default.float-left.d-md-none.d-lg-none.d-xl-none{ type: "button", data: { toggle: "dropdown" } }
42 43
        Options
        = icon('caret-down')
Clement Ho's avatar
Clement Ho committed
44
      .dropdown-menu.dropdown-menu-right.d-lg-none.d-xl-none
45
        %ul
46
          - unless current_user == @issue.author
47
            %li= link_to 'Report abuse', new_abuse_report_path(user_id: @issue.author.id, ref_url: issue_url(@issue))
48
          - if can_update_issue
49
            %li= link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, format: 'json'), class: "btn-close js-btn-issue-action #{issue_button_visibility(@issue, true)}", title: 'Close issue'
50
          - if can_reopen_issue
51
            %li= link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), class: "btn-reopen js-btn-issue-action #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
52
          - if can_report_spam
53
            %li= link_to 'Submit as spam', mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'btn-spam', title: 'Submit as spam'
54 55 56 57
          - if can_create_issue
            - if can_update_issue || can_report_spam
              %li.divider
            %li= link_to 'New issue', new_project_issue_path(@project), title: 'New issue', id: 'new_issue_link'
58

59
    = render 'shared/issuable/close_reopen_button', issuable: @issue, can_update: can_update_issue, can_reopen: can_reopen_issue
60

61
    - if can_report_spam
Clement Ho's avatar
Clement Ho committed
62
      = link_to 'Submit as spam', mark_as_spam_project_issue_path(@project, @issue), method: :post, class: 'd-none d-sm-none d-md-block btn btn-grouped btn-spam', title: 'Submit as spam'
63
    - if can_create_issue
Takuya Noguchi's avatar
Takuya Noguchi committed
64
      = link_to new_project_issue_path(@project), class: 'd-none d-sm-none d-md-block btn btn-grouped btn-success btn-inverted', title: 'New issue', id: 'new_issue_link' do
65
        New issue
66

67
.issue-details.issuable-details
68
  .detail-page-description.content-block
69
    -# haml-lint:disable InlineJavaScript
70
    %script#js-issuable-app-initial-data{ type: "application/json" }= issuable_initial_data(@issue).to_json
71
    #js-issuable-app
72 73 74 75 76
      %h2.title= markdown_field(@issue, :title)
      - if @issue.description.present?
        .description{ class: can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '' }
          .wiki= markdown_field(@issue, :description)
          %textarea.hidden.js-task-list-field= @issue.description
77

78
      = edited_time_ago_with_tooltip(@issue, placement: 'bottom', html_class: 'issue-edited-ago js-issue-edited-ago')
79

80
    #merge-requests{ data: { url: referenced_merge_requests_project_issue_path(@project, @issue) } }
Phil Hughes's avatar
Phil Hughes committed
81
      // This element is filled in using JavaScript.
82

83 84 85
    - if can?(current_user, :download_code, @project)
      #related-branches{ data: { url: related_branches_project_issue_path(@project, @issue) } }
        // This element is filled in using JavaScript.
86

87
  .content-block.emoji-block.emoji-block-sticky
88
    .row
89
      .col-md-12.col-lg-6.js-noteable-awards
90
        = render 'award_emoji/awards_block', awardable: @issue, inline: true
91 92
      .col-md-12.col-lg-6.new-branch-col
        #js-vue-discussion-filter{ data: { default_filter: current_user&.notes_filter_for(@issue), notes_filters: UserPreference.notes_filters.to_json } }
93
        = render 'new_branch' unless @issue.confidential?
94

95
  = render_if_exists 'projects/issues/discussion'
Jacob Schatz's avatar
Jacob Schatz committed
96

97
= render 'shared/issuable/sidebar', issuable_sidebar: @issuable_sidebar, assignees: @issue.assignees