]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2450 Display the last comment on each review in the Reviews page
authorFabrice Bellingard <bellingard@gmail.com>
Fri, 20 May 2011 10:10:43 +0000 (12:10 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Fri, 20 May 2011 10:10:43 +0000 (12:10 +0200)
sonar-server/src/main/webapp/WEB-INF/app/models/review.rb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb
sonar-server/src/main/webapp/stylesheets/style.css

index 55d7dce4efe12c7ad767213d2dbddcbec3e302a1..c9837436aeed6458eca7837bee6876ebbd58909d 100644 (file)
@@ -144,7 +144,7 @@ class Review < ActiveRecord::Base
       end
     end
 
-    Review.find(:all, :include => [ 'review_comments' ], :order => 'created_at DESC', :conditions => [conditions.join(' AND '), values], :limit => 200)
+    Review.find(:all, :include => [ 'review_comments', 'project', 'user', 'assignee', 'resource' ], :order => 'created_at DESC', :conditions => [conditions.join(' AND '), values], :limit => 200)
   end
 
   def self.reviews_to_xml(reviews, convert_markdown=false)
index 9946a4564f88da4df7452fa2aad68bb9fd4ba582..1a07f21c8793661f7633bc10a6f86695a6c84c30 100644 (file)
@@ -103,6 +103,7 @@ function reviewIdFieldModified(field) {
       <tbody>
       <%
          @reviews.each do |review|
+           comment = review.comments.first
       %>
         <tr class="<%= cycle('even', 'odd') -%>">
           <td><img src="<%= ApplicationController.root_context -%>/images/status/<%= review.status -%>.png" title="<%= review.status.capitalize -%>"/></td>
@@ -112,6 +113,12 @@ function reviewIdFieldModified(field) {
           <td><img src="<%= ApplicationController.root_context -%>/images/priority/<%= review.severity -%>.png" title="<%= review.severity.capitalize -%>"/></td>
           <td>
             <%= link_to h(review.title), :controller => "reviews", :action => "view", :id => review.id -%>
+            <div class="discussionComment">
+              <h4>
+                <%= image_tag("reviews/comment.png") -%> &nbsp;<b><%= comment.user.name -%></b> (<%= distance_of_time_in_words_to_now(comment.created_at) -%>)
+                     </h4>
+                     <%= comment.html_text -%>
+               </div>            
           </td>
           <td><%= review.project.name -%>
             <br/><span class="note"><%= review.resource.long_name -%></span></td>
index 19d6f6777fedc63061e30c08fca9f6c78616342c..dbf66f8982d0d5eed211a679dd596a03694c79c1 100644 (file)
@@ -887,6 +887,13 @@ div.discussionComment {
        margin: 0;
        padding: 5px 10px;
 }
+table#reviews-list div.discussionComment {
+       background-color: transparent;
+       border-top: none;
+       border-left: 1px solid #DDDDDD;
+       margin: 5px 0 0 10px;
+       padding: 0px 10px;
+}
 div.discussionComment h4 {
   font-size: 90%;
   margin-bottom: 2px;