diff options
author | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-20 12:10:43 +0200 |
---|---|---|
committer | Fabrice Bellingard <bellingard@gmail.com> | 2011-05-20 12:10:43 +0200 |
commit | 42fea86914b122bcd5b97a9bd1af363b58dc8375 (patch) | |
tree | 907cc95aaadccfcd0077c18466afb96f52de5e72 | |
parent | 42b47a0e4f095b2855f0cc7725116cf2d20a4ca4 (diff) | |
download | sonarqube-42fea86914b122bcd5b97a9bd1af363b58dc8375.tar.gz sonarqube-42fea86914b122bcd5b97a9bd1af363b58dc8375.zip |
SONAR-2450 Display the last comment on each review in the Reviews page
3 files changed, 15 insertions, 1 deletions
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) { <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") -%> <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> 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; |