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

.float-left.btn-group.append-right-10.droplab-dropdown.comment-type-dropdown.js-comment-type-dropdown
  %input.btn.btn-nr.btn-success.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 btn-success js-note-new-discussion js-disable-on-submit', data: { 'dropdown-trigger' => '#resolvable-comment-menu' }, 'aria-label' => _('Open comment type dropdown') do
      = icon('caret-down', class: 'toggle-icon')

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

      %li.divider.droplab-item-ignore

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