diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2012-02-20 09:55:54 +0100 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2012-02-20 09:55:54 +0100 |
commit | 8143b2c18b7fa996b8ddc8e45db5372481408197 (patch) | |
tree | 31986ab6686a4e5df6d563420a30aaba4dac33aa | |
parent | dedb5f07a5a1ffa4c098a751d716ccebd2353a54 (diff) | |
download | sonarqube-8143b2c18b7fa996b8ddc8e45db5372481408197.tar.gz sonarqube-8143b2c18b7fa996b8ddc8e45db5372481408197.zip |
SONAR-3242 Add a "Reply" action on the last comment
+ always show the actions, in order to make it simpler to comment
reviews.
4 files changed, 26 insertions, 15 deletions
diff --git a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties index d6ae22140e9..5ba35c04574 100644 --- a/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-l10n-en-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -423,6 +423,9 @@ reviews.resolved=Resolved reviews.resolved_submit=Resolved reviews.reopen=Reopen reviews.reopen_submit=Reopen +reviews.reply=Reply +reviews.edit=Edit +reviews.delete=Delete reviews.status.REOPENED=Reopened reviews.status.RESOLVED=Resolved reviews.status.OPEN=Open diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb index 53fe40a4d2a..9ee0588e265 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb @@ -103,12 +103,14 @@ <% if current_user.id == review_comment.user_id %> - <%= link_to_remote message('edit'), + <%= link_to_function message('reviews.reply'), "sRF(#{violation.id})", :name => 'bReply' -%> + + <%= link_to_remote message('reviews.edit'), :url => {:controller => "reviews", :action => "violation_comment_form", :comment_id => review_comment.id, :id => violation.id}, :update => "lastComment" + violation.id.to_s, :complete => "$('vActions#{violation.id}').hide();$('commentActions#{violation.id}').hide();$('commentText#{violation.id}').focus();" -%> - <%= link_to_remote message('delete'), + <%= link_to_remote message('reviews.delete'), :url => {:controller => "reviews", :action => "violation_delete_comment", :comment_id => review_comment.id, :id => violation.id}, :update => "vId" + violation.id.to_s, :confirm => message('reviews.do_you_want_to_delete_comment') -%> @@ -128,6 +130,9 @@ </div> <% end + %> + <div class="discussionComment" id="replyForm<%= violation.id -%>" style="display:none"></div> + <% end %> </div> diff --git a/sonar-server/src/main/webapp/javascripts/resource.js b/sonar-server/src/main/webapp/javascripts/resource.js index 193a8b4fe3e..77a5a083779 100644 --- a/sonar-server/src/main/webapp/javascripts/resource.js +++ b/sonar-server/src/main/webapp/javascripts/resource.js @@ -49,6 +49,22 @@ function sCF(violation_id) { return false; } +//show the form to reply to a comment +function sRF(violation_id) { +$('vActions' + violation_id).hide(); +new Ajax.Updater('replyForm' + violation_id, + baseUrl + '/reviews/violation_comment_form/' + violation_id, + { + asynchronous:true, + evalScripts:true, + onComplete:function (request) { + $('replyForm' + violation_id).show(); + $('commentText' + violation_id).focus(); + } + }); +return false; +} + // show the form to change severity function sCSF(violation_id) { $('vActions' + violation_id).hide(); diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index f9dac91e4cc..a1b3af8ecdf 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -913,19 +913,6 @@ ul.operations li img { font-size: 12px; } -.sources2 div.violation .actions, #global_violations div.violation .actions { - visibility: hidden; -} - -.sources2 div.violation:hover .actions, #global_violations div.violation:hover .actions { - visibility: visible; -} - -.sources2 div.violation .actions form, #global_violations div.violation .actions form { - display: inline; - visibility: visible; -} - .sources2 td.reviewForm { width: 100%; padding: 10px; |