]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-1973, SONAR-2327 Fix issues based on Freddy's feedback
authorFabrice Bellingard <bellingard@gmail.com>
Thu, 28 Apr 2011 08:00:21 +0000 (10:00 +0200)
committerFabrice Bellingard <bellingard@gmail.com>
Thu, 28 Apr 2011 13:15:49 +0000 (15:15 +0200)
sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_violation.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_comment_form.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_review.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_violation_comment_form.html.erb

index af3bb857f5391b1f11c517377bb183b79abc77b4..ccc33e692ffeeb164db48ef35d528eed6d3a6696 100644 (file)
@@ -315,13 +315,13 @@ module ApplicationHelper
     period_index=nil if period_index && period_index<=0
     if resource.display_dashboard?
       if options[:dashboard]
-        link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title])
+        link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => (resource.copy_resource_id||resource.id), :period => period_index, :tab => options[:tab]}}, :title => options[:title])
       else
         # stay on the same page (for example components)
-        link_to(name || resource.name, {:overwrite_params => {:id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title])
+        link_to(name || resource.name, {:overwrite_params => {:id => (resource.copy_resource_id||resource.id), :period => period_index, :tab => options[:tab]}}, :title => options[:title])
       end
     else
-      link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id, :period => period_index}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title])
+      link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id, :period => period_index, :tab => options[:tab]}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title])
     end
   end
 
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/markdown/_help.html.erb
new file mode 100644 (file)
index 0000000..d116702
--- /dev/null
@@ -0,0 +1,16 @@
+<h3>Help Tips</h3>
+<table>
+  <tr>
+    <td>*bold*</td>
+    <td class="sep"></td>
+    <td><b>bold</b></td>
+  </tr>
+  <tr>
+    <td>``code``</td>
+    <td class="sep"></td>
+    <td><code>code</code></td>
+  </tr>
+  <tr>
+    <td colspan="3">* Bulleted point</td>
+  </tr>
+</table>
\ No newline at end of file
index 70e0c63094b233eab44eb07ca15d764ef5d6c66f..aa187b7b5be41493bc824113006b9f45949c0ce1 100644 (file)
     <% if current_user %>
     <span class="actions" id="vActions<%= violation.id -%>">
       <%= image_tag("sep12.png") -%>
-        <% if violation.review %>
+        <% 
+          if violation.review 
+            unless violation.false_positive? 
+        %>
         &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 %>        
+        <%
+            end 
+          else 
+        %>        
         &nbsp;
         <%= link_to_remote "Review",
                :url => { :controller => "reviews", :action => "violation_comment_form", :id => violation.id },
@@ -50,7 +56,7 @@
         <% end %>
       
         &nbsp;
-        <%= link_to_remote (violation.false_positive? ? "Unflag false-positive" : "Flag as false-positive"),
+        <%= link_to_remote (violation.false_positive? ? "Unflag as 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,
                        :complete => "$('vActions" + violation.id.to_s + "').hide();$('reviewForm" + violation.id.to_s + "').show();$('commentText" + violation.id.to_s + "').focus();" -%>
index 6cb2a2bd58e0dc83ebff473963376207b3935091..58beeb5ac6544116f91a8856ccd058980cd8a619 100644 (file)
       </td>
       <td class="sep"></td>
       <td style="vertical-align:top;width: 90px">
-        <h3>Help Tips</h3>
-        <table>
-          <tr>
-            <td>*bold*</td>
-            <td class="sep"></td>
-            <td><b>bold</b></td>
-          </tr>
-          <tr>
-            <td>''code''</td>
-            <td class="sep"></td>
-            <td><code>code</code></td>
-          </tr>
-          <tr>
-            <td colspan="3">* Bulleted point</td>
-          </tr>
-        </table>
+        <%= render :partial => 'markdown/help' -%>
       </td>
     </tr>
   </table>
index aa13895b6edb54908ab97f3e17a134e5eb25fa68..2cb37687ff4bb45179cf421965191ed3878db82d 100644 (file)
@@ -71,7 +71,7 @@
           <td class="val" colspan="3">
                <%= qualifier_icon(@review.resource) -%> 
                <% if !review.on_project? %> <%= @review.project.long_name -%> <%= image_tag 'sep12.png' -%> <% end %>
-               <%= link_to_resource(review.resource, review.resource.long_name) %>
+               <%= link_to_resource(review.resource, review.resource.long_name, { :tab => :violations } ) %>
           </td>
         </tr>
   </table>
index daa7600ffcf6815dc1eab92f4a025bc714c300ad..a080d8b0e5e4c77b1090c5971a6e8d95d420a694 100644 (file)
       </td>
       <td class="sep"></td>
       <td style="vertical-align:top;width: 90px">
-        <h3>Help Tips</h3>
-        <table>
-          <tr>
-            <td>*bold*</td>
-            <td class="sep"></td>
-            <td><b>bold</b></td>
-          </tr>
-          <tr>
-            <td>''code''</td>
-            <td class="sep"></td>
-            <td><code>code</code></td>
-          </tr>
-          <tr>
-            <td colspan="3">* Bulleted point</td>
-          </tr>
-        </table>
+        <%= render :partial => 'markdown/help' -%>
       </td>
     </tr>
   </table>