]> source.dussan.org Git - sonarqube.git/commitdiff
[SONAR-1973] "Add comment" link should not be visible if user is not
authorFabrice Bellingard <bellingard@gmail.com>
Sun, 10 Apr 2011 13:59:40 +0000 (15:59 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 20 Apr 2011 06:49:58 +0000 (08:49 +0200)
authenticated

sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb

index b06f1d99355e4214b33ebee70b74668d972a7817..563ae0f9461687e9bb483ec65ec3203b6a43a95e 100644 (file)
@@ -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">\r
+      User name: <%= h(review.user.name) -%>\r
+      <br/>\r
+      Status: <%= h(review.status) -%>\r
+      <br/>\r
+      Severity: <%= h(review.severity) -%>\r
+      <br/>\r
+      \r
+      <div>\r
+        <% unless review.review_comments.blank? \r
+                    review.review_comments.each do |review_comment|\r
+               %>\r
+               <div id="commentReview" style="border:solid 1px grey; margin:2px">\r
+                   <%= l review_comment.created_at -%>, by <%= h(review_comment.user.name) -%>\r
+                   » \r
+                   <%= h(review_comment.review_text) -%>\r
+            <br/>\r
+        </div>\r
+               <% \r
+                    end\r
+                  end\r
+               %>\r
+      </div>\r
+      \r
+      <% if current_user %>\r
+         <%= link_to_remote "Add a comment", \r
+                       :url => { :controller => "reviews", :action => "form_comment", :review_id => review.id, :rule_failure_id => review.rule_failure_id },\r
+                       :update => "createComment" + review.id.to_s, \r
+                       :complete => "$('commentText" + review.id.to_s + "').focus()" -%>\r
+      \r
+         <div id="createComment<%= review.id -%>"></div>\r
+      <% end %>\r
+\r
+  </div>\r