summaryrefslogtreecommitdiff
path: root/app/views/projects/notes/_comment_button.html.haml
blob: 008363263b394bf2f3d5e9d6cf0393610b4e705c (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
- noteable_name = @note.noteable.human_class_name

.pull-left.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
  %input.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button{ type: 'submit', value: 'Comment' }

  - if @note.can_be_discussion_note?
    = button_tag type: 'button', class: 'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => 'Open comment type dropdown' do
      = icon('caret-down')

    %ul#resolvable-comment-menu.dropdown-menu{ data: { dropdown: true } }
      %li#comment.droplab-item-selected{ data: { value: '', 'button-text' => 'Comment', 'secondary-button-text' => "Comment & close #{noteable_name}" } }
        = icon('check')
        .description
          %strong Comment
          %p
            Add a general comment to this #{noteable_name}.

      %li.divider

      %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => "Start discussion & close #{noteable_name}" } }
        = icon('check')
        .description
          %strong Start discussion
          %p
            = succeed '.' do
              Discuss a specific suggestion or question
              - if @note.noteable.supports_resolvable_notes?
                that needs to be resolved