show.html.haml 5.04 KB
Newer Older
1
- @content_class = "limit-container-width" unless fluid_layout
2
- page_title           "#{@issue.title} (#{@issue.to_reference})", "Issues"
3 4
- page_description     @issue.description
- page_card_attributes @issue.card_attributes
5 6
- content_for :page_specific_javascripts do
  = page_specific_javascript_tag('lib/vue_resource.js')
7

8 9
.clearfix.detail-page-header
  .issuable-header
Phil Hughes's avatar
Phil Hughes committed
10
    .issuable-status-box.status-box.status-box-closed{ class: issue_button_visibility(@issue, false) }
11 12 13
      = icon('check', class: "hidden-sm hidden-md hidden-lg")
      %span.hidden-xs
        Closed
Phil Hughes's avatar
Phil Hughes committed
14
    .issuable-status-box.status-box.status-box-open{ class: issue_button_visibility(@issue, true) }
15 16
      = icon('circle-o', class: "hidden-sm hidden-md hidden-lg")
      %span.hidden-xs Open
17

18
    %a.btn.btn-default.pull-right.visible-xs-block.gutter-toggle.issuable-gutter-toggle.js-sidebar-toggle{ href: "#" }
Jacob Schatz's avatar
Jacob Schatz committed
19
      = icon('angle-double-left')
20

21
    .issuable-meta
22
      = confidential_icon(@issue)
23
      = issuable_meta(@issue, @project, "Issue")
24

Phil Hughes's avatar
Phil Hughes committed
25 26 27
  - if can?(current_user, :create_issue, @project) || can?(current_user, :update_issue, @issue)
    .issuable-actions
      .clearfix.issue-btn-group.dropdown
Clement Ho's avatar
Clement Ho committed
28
        %button.btn.btn-default.pull-left.hidden-md.hidden-lg{ type: "button", data: { toggle: "dropdown" } }
Phil Hughes's avatar
Phil Hughes committed
29
          Options
30
          = icon('caret-down')
Phil Hughes's avatar
Phil Hughes committed
31 32 33 34 35 36 37 38 39 40 41 42
        .dropdown-menu.dropdown-menu-align-right.hidden-lg
          %ul
            - if can?(current_user, :create_issue, @project)
              %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 }, status_only: true, 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 }, status_only: true, 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)
43 44 45
            - if @issue.submittable_as_spam? && current_user.admin?
              %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'
46

Phil Hughes's avatar
Phil Hughes committed
47
        - if can?(current_user, :create_issue, @project)
48
          = 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
Phil Hughes's avatar
Phil Hughes committed
49 50
            New issue
        - if can?(current_user, :update_issue, @issue)
51
          = link_to 'Reopen issue', issue_path(@issue, issue: { state_event: :reopen }, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "hidden-xs hidden-sm btn btn-grouped btn-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
52
          = link_to 'Close issue', issue_path(@issue, issue: { state_event: :close }, status_only: true, format: 'json'), data: {no_turbolink: true}, class: "hidden-xs hidden-sm btn btn-grouped btn-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'
53
          - if @issue.submittable_as_spam? && current_user.admin?
54
            = 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'
55
          = link_to 'Edit', edit_namespace_project_issue_path(@project.namespace, @project, @issue), class: 'hidden-xs hidden-sm btn btn-grouped issuable-edit'
56

57

58
.issue-details.issuable-details
Nur Rony's avatar
Nur Rony committed
59
  .detail-page-description.content-block{ class: ('hide-bottom-border' unless @issue.description.present? ) }
60
    %h2.title
61
      = markdown_field(@issue, :title)
62
    - if @issue.description.present?
Phil Hughes's avatar
Phil Hughes committed
63
      .description{ class: can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '' }
64 65
        .wiki
          = preserve do
66
            = markdown_field(@issue, :description)
67 68 69
        %textarea.hidden.js-task-list-field
          = @issue.description
    = edited_time_ago_with_tooltip(@issue, placement: 'bottom', html_class: 'issue_edited_ago')
70

Phil Hughes's avatar
Phil Hughes committed
71 72
    #merge-requests{ data: { url: referenced_merge_requests_namespace_project_issue_url(@project.namespace, @project, @issue) } }
      // This element is filled in using JavaScript.
73

Phil Hughes's avatar
Phil Hughes committed
74 75
    #related-branches{ data: { url: related_branches_namespace_project_issue_url(@project.namespace, @project, @issue) } }
      // This element is filled in using JavaScript.
76

Fatih Acet's avatar
Fatih Acet committed
77 78 79
  .content-block.content-block-small
    = render 'new_branch'
    = render 'award_emoji/awards_block', awardable: @issue, inline: true
80

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

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