summaryrefslogtreecommitdiff
path: root/app/views/projects/issues/show.html.haml
blob: 2a871966aa832d4dd79bfc2166a9bec7ed09ccad (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
- @content_class = "limit-container-width" unless fluid_layout
- page_title           "#{@issue.title} (#{@issue.to_reference})", "Issues"
- page_description     @issue.description
- page_card_attributes @issue.card_attributes

.clearfix.detail-page-header
  .issuable-header
    .issuable-status-box.status-box.status-box-closed{ class: issue_button_visibility(@issue, false) }
      = icon('check', class: "hidden-sm hidden-md hidden-lg")
      %span.hidden-xs
        Closed
    .issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) }
      = icon('circle-o', class: "hidden-sm hidden-md hidden-lg")
      %span.hidden-xs Open

    %a.btn.btn-default.pull-right.visible-xs-block.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" }
      = icon('angle-double-left')

    .issuable-meta
      = confidential_icon(@issue)
      = issuable_meta(@issue, @project, "Issue")

  .issuable-actions
    .clearfix.issue-btn-group.dropdown
      %button.btn.btn-default.pull-left.hidden-md.hidden-lg{ type: "button", data: { toggle: "dropdown" } }
        Options
        = icon('caret-down')
      .dropdown-menu.dropdown-menu-align-right.hidden-lg
        %ul
          %li
            = link_to 'New issue', new_namespace_project_issue_path(@project.namespace, @project), title: 'New issue', id: 'new_issue_link'
          - if can?(current_user, :update_issue, @issue)
            %li
              = link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), data: {no_turbolink: true}, class: "btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
            %li
              = link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, format: 'json'), data: {no_turbolink: true}, class: "btn-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'
            %li
              = link_to 'Edit', edit_namespace_project_issue_path(@project.namespace, @project, @issue)
          - if @issue.submittable_as_spam_by?(current_user)
            %li
              = link_to 'Submit as spam', mark_as_spam_namespace_project_issue_path(@project.namespace, @project, @issue), method: :post, class: 'btn-spam', title: 'Submit as spam'

    = link_to new_namespace_project_issue_path(@project.namespace, @project), class: 'hidden-xs hidden-sm btn btn-grouped new-issue-link btn-new btn-inverted', title: 'New issue', id: 'new_issue_link' do
      New issue
    - if can?(current_user, :update_issue, @issue)
      = link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, format: 'json'), data: {no_turbolink: true}, class: "hidden-xs hidden-sm btn btn-grouped btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
      = link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, format: 'json'), data: {no_turbolink: true}, class: "hidden-xs hidden-sm btn btn-grouped btn-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'
      - if @issue.submittable_as_spam_by?(current_user)
        = link_to 'Submit as spam', mark_as_spam_namespace_project_issue_path(@project.namespace, @project, @issue), method: :post, class: 'hidden-xs hidden-sm btn btn-grouped btn-spam', title: 'Submit as spam'
      = link_to 'Edit', edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: 'hidden-xs hidden-sm btn btn-grouped issuable-edit'

.issue-details.issuable-details
  .detail-page-description.content-block
    .issue-title-data.hidden{ "data" => { "initial-title" => markdown_field(@issue, :title),
      "endpoint" => rendered_title_namespace_project_issue_path(@project.namespace, @project, @issue),
    } }
    .issue-title-entrypoint
    - 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
    = edited_time_ago_with_tooltip(@issue, placement: 'bottom', html_class: 'issue_edited_ago')

    #merge-requests{ data: { url: referenced_merge_requests_namespace_project_issue_url(@project.namespace, @project, @issue) } }
      // This element is filled in using JavaScript.

    #related-branches{ data: { url: related_branches_namespace_project_issue_url(@project.namespace, @project, @issue) } }
      // This element is filled in using JavaScript.

  .content-block.content-block-small
    = render 'new_branch' unless @issue.confidential?
    = render 'award_emoji/awards_block', awardable: @issue, inline: true

  %section.issuable-discussion
    = render 'projects/issues/discussion'

= render 'shared/issuable/sidebar', issuable: @issue

= page_specific_javascript_bundle_tag('common_vue')
= page_specific_javascript_bundle_tag('issue_show')