- <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