]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1973 Rework action link positions
authorFabrice Bellingard <bellingard@gmail.com>
Tue, 26 Apr 2011 13:37:57 +0000 (15:37 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Tue, 26 Apr 2011 16:46:47 +0000 (18:46 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb

index a6adaa5e811b9e8c8395ed6ab929ef21a3d4306c..6dd08dd9fb6c46d8f8d0d3187c20f6ed320be49c 100644 (file)
     <% if current_user %>
     <span class="actions" id="vActions<%= violation.id -%>">
       <%= image_tag("sep12.png") -%>
-      &nbsp;
+        <% if violation.review %>
+        &nbsp;
         <%= link_to_remote (violation.review && violation.review.assignee_id ? "Reassign" : "Assign"),  
                        :url => { :controller => "reviews", :action => "violation_assign_form", :violation_id => violation.id},
                        :update => "vActions" + violation.id.to_s,
                        :complete => "$('vActions" + violation.id.to_s + "').show();$('assignee_id').focus();" -%>
+        <% else %>        
+        &nbsp;
+        <%= link_to_remote "Review",
+               :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id },
+               :update => "reviewForm" + violation.id.to_s,
+               :complete => "$('vActions#{violation.id}').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus()" -%>
+        <% end %>
+      
         &nbsp;
-
         <%= link_to_remote (violation.false_positive? ? "Unflag false-positive" : "Flag as false-positive"),
                        :url => { :controller => "reviews", :action => "violation_false_positive_form", :id => violation.id, :false_positive => !violation.false_positive? },
                        :update => "reviewForm" + violation.id.to_s,
 
 
 
-<% if current_user %>
+<% if current_user && violation.review %>
 <div style="padding: 5px" id="commentAction<%= violation.id -%>">
   <%= link_to_remote "Add comment",
                :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id },
index 80a5c613d14d3358b2a361dc850e8145cf0bf975..f9b6a8cd35a428163c4227e0bdcfe433d7a6ba56 100644 (file)
@@ -30,7 +30,7 @@
                  Created by:
           </td>
           <td  class="val">
-                 <%= h(review.user.name) -%> at <%= l(review.created_at) -%>
+                 <%= h(review.user.name) -%> on <%= l(review.created_at, :format => :long) -%>
           </td>
         </tr>
        <% if review.rule %>