aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Bellingard <bellingard@gmail.com>2011-04-12 16:35:22 +0200
committerFabrice Bellingard <bellingard@gmail.com>2011-04-20 08:52:55 +0200
commit72d8bb664b76d15f78fcfc1817a98d2bb2599a9a (patch)
tree6c0c0ea4d7e7d4380f93323c0a126ef3beead6eb
parent41f21f268851ae24bdcd6451a04e2e091414e781 (diff)
downloadsonarqube-72d8bb664b76d15f78fcfc1817a98d2bb2599a9a.tar.gz
sonarqube-72d8bb664b76d15f78fcfc1817a98d2bb2599a9a.zip
[SONAR-1973] Improve UI
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb11
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb8
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb45
4 files changed, 37 insertions, 29 deletions
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
index 574765e5114..1a5f54892d7 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
@@ -40,7 +40,7 @@ public class SchemaMigration {
- complete the Derby DDL file used for unit tests : sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
*/
- public static final int LAST_VERSION = 190;
+ public static final int LAST_VERSION = 191;
public final static String TABLE_NAME = "schema_migrations";
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
index 3da5376fb0b..6ab4515f77d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
@@ -10,10 +10,15 @@
<td width="30px" valign="top">
<% if current_user && violation.reviews.blank? %>
- <%= link_to_remote image_tag("reviews/add.png"),
+ <%= link_to_remote image_tag("reviews/+review.png"),
:url => { :controller => "reviews", :action => "form", :violation_id => violation.id },
:update => "reviewFailure" + violation.id.to_s,
- :html => { :id => "createReviewLink" + violation.id.to_s },
+ :html => { :id => "createReviewLink" + violation.id.to_s, :title => "Add a review" },
+ :complete => "$('reviewFailure" + violation.id.to_s + "').style.display='';$('reviewText').focus();" -%>
+ <%= link_to_remote image_tag("reviews/+false-positive.png"),
+ :url => { :controller => "reviews", :action => "form", :violation_id => violation.id },
+ :update => "reviewFailure" + violation.id.to_s,
+ :html => { :id => "createReviewLink" + violation.id.to_s, :title => "Flag as false-positive" },
:complete => "$('reviewFailure" + violation.id.to_s + "').style.display='';$('reviewText').focus();" -%>
<% end %>
</td>
@@ -31,7 +36,7 @@
<span class="violation_date"><%= duration==0 ? 'today' : "#{duration} days ago" -%></span>
<% end %>
- <div id="reviewFailure<%= violation.id -%>" style="padding:5px; background:white; display:<%= displayReviewFailureDiv -%>">
+ <div id="reviewFailure<%= violation.id -%>" style="display:<%= displayReviewFailureDiv -%>">
<%= render :partial => "reviews/list", :locals => { :reviews => violation.reviews } %>
</div>
</td>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb
index ea5710840cb..6cf80541e2a 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb
@@ -1,10 +1,8 @@
<% form_for :review_comment, @review_comment do |f| %>
<%= f.hidden_field :review_id %>
- Review by: <%= @review_comment.user.name -%>
- <br/>
- Comment:
- <br/>
- <%= f.text_area :review_text, :rows => 10, :id => "commentText" + @review_comment.review_id.to_s %>
+ <%= f.text_area :review_text, :rows => 8,
+ :id => "commentText" + @review_comment.review_id.to_s,
+ :style => "width:100%" %>
<br/>
<%= submit_to_remote 'create_btn', 'Add comment',
:url => { :action => 'create_comment', :rule_failure_id => @rule_failure_id } %>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb
index 563ae0f9461..1007acd9061 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb
@@ -1,34 +1,39 @@
- <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 id="review<%= review.id -%>" style="margin: 5px 5px 5px 20px">
+ <div>
+ <b>Reviewed by <%= h(review.user.name) -%></b> - <%= l review.created_at -%>
+ <br/>
+ Status: <%= h(review.status) -%> / Severity: <%= h(review.severity) -%>
+ </div>
- <div>
+ <div style="margin: 5px 0px 0px 30px">
+ <table style="border-left:solid 3px grey">
<% 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>
+ <tr>
+ <td style="width:180px; vertical-align:top; padding: 5px; border:solid 1px grey">
+ <%= image_tag("user.png") -%> <b><%= h(review_comment.user.name) -%></b> »
+ <br/><%= l review_comment.created_at -%>
+ </td>
+ <td style="width:1000px; vertical-align:top; padding: 5px; border:solid 1px grey; background: white">
+ <%= h(review_comment.review_text) -%>
+ </td>
+ </tr>
<%
end
end
%>
- </div>
+ </table>
- <% if current_user %>
- <%= link_to_remote "Add a comment",
+ <% if current_user %>
+ <div style="width:1200px; text-align: right; padding: 5px">
+ <%= 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>
- <% end %>
+ </div>
+ <div id="createComment<%= review.id -%>"></div>
+ <% end %>
+ </div>
</div>