summaryrefslogtreecommitdiff
path: root/app/views/projects/notes
diff options
context:
space:
mode:
authorLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-07 02:50:10 +0100
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-07 02:50:10 +0100
commit907b754173ed4185574c38ded0a173360d073085 (patch)
treedf3fc2ffb07a48cad1d812e34cdf2bb796dbbdfd /app/views/projects/notes
parentbb4bc215f853da509592d1698cfe9cc860bc67bd (diff)
downloadgitlab-ce-907b754173ed4185574c38ded0a173360d073085.tar.gz
Fixed bugs and added tests
Diffstat (limited to 'app/views/projects/notes')
-rw-r--r--app/views/projects/notes/_comment_button.html.haml5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/views/projects/notes/_comment_button.html.haml b/app/views/projects/notes/_comment_button.html.haml
index 008363263b3..2e65a3bf294 100644
--- a/app/views/projects/notes/_comment_button.html.haml
+++ b/app/views/projects/notes/_comment_button.html.haml
@@ -1,4 +1,5 @@
- noteable_name = @note.noteable.human_class_name
+- noteable_state_action = noteable_name =~ /(merge request|issue)/ && @note.noteable['state'] == 'closed' ? 'reopen' : 'close'
.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' }
@@ -8,7 +9,7 @@
= 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}" } }
+ %li#comment.droplab-item-selected{ data: { value: '', 'button-text' => 'Comment', 'secondary-button-text' => "Comment & #{noteable_state_action} #{noteable_name}" } }
= icon('check')
.description
%strong Comment
@@ -17,7 +18,7 @@
%li.divider
- %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => "Start discussion & close #{noteable_name}" } }
+ %li#discussion{ data: { value: 'DiscussionNote', 'button-text' => 'Start discussion', 'secondary-button-text' => "Start discussion & #{noteable_state_action} #{noteable_name}" } }
= icon('check')
.description
%strong Start discussion