]> source.dussan.org Git - sonarqube.git/commitdiff
[SONAR-1973] Improve UI
authorFabrice Bellingard <bellingard@gmail.com>
Tue, 12 Apr 2011 14:35:22 +0000 (16:35 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Wed, 20 Apr 2011 06:52:55 +0000 (08:52 +0200)
sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_form_comment.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_view.html.erb

index 574765e51148dbf0b43136a002a7d24f86cd9b27..1a5f54892d7783c25817a667cb6a0218b47dea03 100644 (file)
@@ -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";
 
index 3da5376fb0b9d6142c64e2be674164d592fc08a6..6ab4515f77d1f1c01d7d41baab75446b72da1f9c 100644 (file)
     
       <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>
index ea5710840cb8b90409079d3c9be2ca6ebe5a2c7d..6cf80541e2a7b86a834899455e77a94860bbbdbe 100644 (file)
@@ -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 } %>
index 563ae0f9461687e9bb483ec65ec3203b6a43a95e..1007acd9061791d0f62340141e7346ec73565c5c 100644 (file)
@@ -1,34 +1,39 @@
-  <div id="review<%= review.id -%>" style="border:solid 1px black; margin:2px">\r
-      User name: <%= h(review.user.name) -%>\r
-      <br/>\r
-      Status: <%= h(review.status) -%>\r
-      <br/>\r
-      Severity: <%= h(review.severity) -%>\r
-      <br/>\r
+  <div id="review<%= review.id -%>" style="margin: 5px 5px 5px 20px">\r
+         <div>\r
+       <b>Reviewed by <%= h(review.user.name) -%></b> - <%= l review.created_at -%>\r
+        <br/>\r
+        Status: <%= h(review.status) -%> / Severity: <%= h(review.severity) -%>      \r
+      </div>\r
       \r
-      <div>\r
+      <div style="margin: 5px 0px 0px 30px">\r
+        <table style="border-left:solid 3px grey">\r
         <% unless review.review_comments.blank? \r
                     review.review_comments.each do |review_comment|\r
                %>\r
-               <div id="commentReview" style="border:solid 1px grey; margin:2px">\r
-                   <%= l review_comment.created_at -%>, by <%= h(review_comment.user.name) -%>\r
-                   » \r
-                   <%= h(review_comment.review_text) -%>\r
-            <br/>\r
-        </div>\r
+                 <tr>\r
+                   <td style="width:180px; vertical-align:top; padding: 5px; border:solid 1px grey">\r
+                               <%= image_tag("user.png") -%> <b><%= h(review_comment.user.name) -%></b> »\r
+                               <br/><%= l review_comment.created_at -%>\r
+                   </td>\r
+                   <td style="width:1000px; vertical-align:top; padding: 5px; border:solid 1px grey; background: white">\r
+                       <%= h(review_comment.review_text) -%>\r
+                   </td>\r
+                 </tr>\r
                <% \r
                     end\r
                   end\r
                %>\r
-      </div>\r
+               </table>\r
       \r
-      <% if current_user %>\r
-         <%= link_to_remote "Add a comment", \r
+        <% if current_user %>\r
+           <div style="width:1200px; text-align: right; padding: 5px">\r
+             <%= link_to_remote "Add a comment", \r
                        :url => { :controller => "reviews", :action => "form_comment", :review_id => review.id, :rule_failure_id => review.rule_failure_id },\r
                        :update => "createComment" + review.id.to_s, \r
                        :complete => "$('commentText" + review.id.to_s + "').focus()" -%>\r
-      \r
-         <div id="createComment<%= review.id -%>"></div>\r
-      <% end %>\r
+           </div>\r
+           <div id="createComment<%= review.id -%>"></div>\r
+        <% end %>\r
+      </div>\r
 \r
   </div>\r