From: Fabrice Bellingard Date: Tue, 12 Apr 2011 14:35:22 +0000 (+0200) Subject: [SONAR-1973] Improve UI X-Git-Tag: 2.8~181 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=72d8bb664b76d15f78fcfc1817a98d2bb2599a9a;p=sonarqube.git [SONAR-1973] Improve UI --- 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 @@ <% 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 %> @@ -31,7 +36,7 @@ <%= duration==0 ? 'today' : "#{duration} days ago" -%> <% end %> -
+
<%= render :partial => "reviews/list", :locals => { :reviews => violation.reviews } %>
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 -%> -
- Comment: -
- <%= 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%" %>
<%= 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 @@ -
- User name: <%= h(review.user.name) -%> -
- Status: <%= h(review.status) -%> -
- Severity: <%= h(review.severity) -%> -
+
+
+ Reviewed by <%= h(review.user.name) -%> - <%= l review.created_at -%> +
+ Status: <%= h(review.status) -%> / Severity: <%= h(review.severity) -%> +
-
+
+ <% unless review.review_comments.blank? review.review_comments.each do |review_comment| %> -
- <%= l review_comment.created_at -%>, by <%= h(review_comment.user.name) -%> - » - <%= h(review_comment.review_text) -%> -
-
+ + + + <% end end %> - +
+ <%= image_tag("user.png") -%> <%= h(review_comment.user.name) -%> » +
<%= l review_comment.created_at -%> +
+ <%= h(review_comment.review_text) -%> +
- <% if current_user %> - <%= link_to_remote "Add a comment", + <% if current_user %> +
+ <%= 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()" -%> - -
- <% end %> +
+
+ <% end %> +