From 42fea86914b122bcd5b97a9bd1af363b58dc8375 Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Fri, 20 May 2011 12:10:43 +0200 Subject: [PATCH] SONAR-2450 Display the last comment on each review in the Reviews page --- sonar-server/src/main/webapp/WEB-INF/app/models/review.rb | 2 +- .../main/webapp/WEB-INF/app/views/reviews/index.html.erb | 7 +++++++ sonar-server/src/main/webapp/stylesheets/style.css | 7 +++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb index 55d7dce4efe..c9837436aee 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/models/review.rb @@ -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) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb index 9946a4564f8..1a07f21c879 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/index.html.erb @@ -103,6 +103,7 @@ function reviewIdFieldModified(field) { <% @reviews.each do |review| + comment = review.comments.first %> @@ -112,6 +113,12 @@ function reviewIdFieldModified(field) { <%= link_to h(review.title), :controller => "reviews", :action => "view", :id => review.id -%> +
+

+ <%= image_tag("reviews/comment.png") -%>  <%= comment.user.name -%> (<%= distance_of_time_in_words_to_now(comment.created_at) -%>) +

+ <%= comment.html_text -%> +
<%= review.project.name -%>
<%= review.resource.long_name -%> diff --git a/sonar-server/src/main/webapp/stylesheets/style.css b/sonar-server/src/main/webapp/stylesheets/style.css index 19d6f6777fe..dbf66f8982d 100644 --- a/sonar-server/src/main/webapp/stylesheets/style.css +++ b/sonar-server/src/main/webapp/stylesheets/style.css @@ -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; -- 2.39.5