summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlfredo Sumaran <a.sumaran@gmail.com>2017-04-05 18:01:45 -0500
committerAlfredo Sumaran <alfredo@gitlab.com>2017-04-05 23:01:43 -0500
commit3871941df7f955d60c12cf53522ccc9965381388 (patch)
tree2cd197fb4f054441e44ced2eafc9412117f4580c
parent5f9478562000d598a1cdea7e6699f7f701d742ba (diff)
downloadgitlab-ce-3871941df7f955d60c12cf53522ccc9965381388.tar.gz
Move discussion button to its own file
Also customizes the message for the “Comment” option to match the current noteable
-rw-r--r--app/views/projects/notes/_comment_type_button.html.haml18
-rw-r--r--app/views/projects/notes/_form.html.haml18
2 files changed, 19 insertions, 17 deletions
diff --git a/app/views/projects/notes/_comment_type_button.html.haml b/app/views/projects/notes/_comment_type_button.html.haml
new file mode 100644
index 00000000000..46376367b16
--- /dev/null
+++ b/app/views/projects/notes/_comment_type_button.html.haml
@@ -0,0 +1,18 @@
+.btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
+ %button.btn.btn-nr.btn-create.comment-btn.js-comment-button.js-comment-submit-button
+ Comment
+ - if @note.can_be_discussion_note?
+ = button_tag type: 'button', class: 'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion', data: { 'dropdown-trigger' => '#resolvable-comment-menu' } do
+ = icon('caret-down')
+ %ul#resolvable-comment-menu.dropdown-menu{ data: { dropdown: true } }
+ %li#comment{ data: { value: '', 'button-text' => 'Comment', 'secondary-button-text' => 'Comment & close merge request' }, class: 'droplab-item-selected' }
+ = icon('check')
+ .description
+ %strong Comment
+ %p= "Add a general comment to this #{@note.noteable_type.titleize.downcase}."
+ %li.divider
+ %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => 'Start discussion & close merge request' } }
+ = icon('check')
+ .description
+ %strong Start discussion
+ %p Discuss a specific suggestion or question that needs to be resolved.
diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
index 929772af3e2..057c6801edf 100644
--- a/app/views/projects/notes/_form.html.haml
+++ b/app/views/projects/notes/_form.html.haml
@@ -28,23 +28,7 @@
.error-alert
.note-form-actions.clearfix
- .btn-group.append-right-10.comment-type-dropdown.js-comment-type-dropdown
- = f.submit 'Comment', class: "btn btn-nr btn-create comment-btn js-comment-button js-comment-submit-button"
- - if @note.can_be_discussion_note?
- = button_tag type: 'button', class: 'btn btn-nr dropdown-toggle comment-btn js-note-new-discussion', data: { 'dropdown-trigger' => '#resolvable-comment-menu' } do
- = icon('caret-down')
- %ul#resolvable-comment-menu.dropdown-menu{ data: { dropdown: true } }
- %li#comment{ data: { value: '', 'button-text' => 'Comment', 'secondary-button-text' => 'Comment & close merge request' }, class: 'droplab-item-selected' }
- = icon('check')
- .description
- %strong Comment
- %p Add a general comment to this merge request.
- %li.divider
- %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => 'Start discussion & close merge request' } }
- = icon('check')
- .description
- %strong Start discussion
- %p Discuss a specific suggestion or question that needs to be resolved.
+ = render partial: 'projects/notes/comment_type_button', locals: { show_close_button: true }
= yield(:note_actions)