diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-04-10 15:59:40 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-04-20 08:49:58 +0200 |
commit | 7b523424f7fbb34f82cac3b0e053c56b122f254a (patch) | |
tree | daad1d370ef89e92c7c10cd0943ba89a1cb7af7c /sonar-server/src/main/webapp | |
parent | e45c2a5959eec47d06e15ec6db101f0975ad0bb0 (diff) | |
download | sonarqube-7b523424f7fbb34f82cac3b0e053c56b122f254a.tar.gz sonarqube-7b523424f7fbb34f82cac3b0e053c56b122f254a.zip |
[SONAR-1973] "Add comment" link should not be visible if user is not
authenticated
Diffstat (limited to 'sonar-server/src/main/webapp')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb index b06f1d99355..563ae0f9461 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb @@ -1,32 +1,34 @@ - <div id="review<%= review.id -%>" style="border:solid 1px black; margin:2px"> - User name: <%= h(review.user.name) -%> - <br/> - Status: <%= h(review.status) -%> - <br/> - Severity: <%= h(review.severity) -%> - <br/> - - <div> - <% unless review.review_comments.blank? - review.review_comments.each do |review_comment| - %> - <div id="commentReview" style="border:solid 1px grey; margin:2px"> - <%= l review_comment.created_at -%>, by <%= h(review_comment.user.name) -%> - » - <%= h(review_comment.review_text) -%> - <br/> - </div> - <% - end - end - %> - </div> - - <%= link_to_remote "Add a comment", - :url => { :controller => "reviews", :action => "form_comment", :review_id => review.id, :rule_failure_id => review.rule_failure_id }, - :update => "createComment" + review.id.to_s, - :complete => "$('commentText" + review.id.to_s + "').focus()" -%> - - <div id="createComment<%= review.id -%>"></div> - - </div> + <div id="review<%= review.id -%>" style="border:solid 1px black; margin:2px">
+ User name: <%= h(review.user.name) -%>
+ <br/>
+ Status: <%= h(review.status) -%>
+ <br/>
+ Severity: <%= h(review.severity) -%>
+ <br/>
+
+ <div>
+ <% unless review.review_comments.blank?
+ review.review_comments.each do |review_comment|
+ %>
+ <div id="commentReview" style="border:solid 1px grey; margin:2px">
+ <%= l review_comment.created_at -%>, by <%= h(review_comment.user.name) -%>
+ »
+ <%= h(review_comment.review_text) -%>
+ <br/>
+ </div>
+ <%
+ end
+ end
+ %>
+ </div>
+
+ <% if current_user %>
+ <%= link_to_remote "Add a comment",
+ :url => { :controller => "reviews", :action => "form_comment", :review_id => review.id, :rule_failure_id => review.rule_failure_id },
+ :update => "createComment" + review.id.to_s,
+ :complete => "$('commentText" + review.id.to_s + "').focus()" -%>
+
+ <div id="createComment<%= review.id -%>"></div>
+ <% end %>
+
+ </div>
|