]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-37 & SONAR-2911 Improve rendering
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 29 Nov 2012 13:23:41 +0000 (14:23 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Thu, 29 Nov 2012 13:24:29 +0000 (14:24 +0100)
- Add breadcrumb bar and put permalink inside
- Move the icons under the snapshot name, version and date

sonar-server/src/main/webapp/WEB-INF/app/controllers/comparison_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_breadcrumb.html.erb

index 6de07617062d54bfd76b60dcf991ce623ddd3675..4d0ebd0ac2b50432846c781725b90558f30ad3a1 100644 (file)
@@ -19,7 +19,7 @@
 #
 
 class ComparisonController < ApplicationController
-
+  
   def index
     snapshots = []
     resource_key = params[:resource]
@@ -57,6 +57,11 @@ class ComparisonController < ApplicationController
     
     @metric_to_choose = Metric.all.select {|m| m.display? && !@metrics.include?(m)}.sort_by(&:short_name)
     
+    # UI breadcrumb and permalink
+    unless @snapshots.empty?
+      @permalink = url_for :controller => 'comparison', :action => 'index', :sids => @snapshots.map {|s| s.id.to_s}.join(','), :metrics => @metrics.map {|m| m.key}.join(',')
+    end
+    add_breadcrumbs message('sidebar.tools'), {:name => message('comparison.page'), :url => {:controller => 'comparison', :action => 'index'}}
   end
   
   def versions
index 938441aaff4d7770fa4d3332f6207c00a515d606..9000761e3a4b0163fc591e136d56b1365074ebee 100644 (file)
@@ -49,7 +49,7 @@
           <th class="thin move-actions" style="padding: 5px !important;">
             <table>
               <tr>
-                <td style="vertical-align: top;">
+                <td style="vertical-align: bottom;">
                   <% if index > 0 %>
                     <a href="#" onclick="moveLeft(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_left.png" title="<%= message('comparison.move_left') -%>"/></a>
                   <% else %>
                   <% end %>
                 </td>
                 <td class="nowrap" style="text-align: center;">
-                  <div style="width: 100%; text-align: center;"><a href="#" onclick="removeFromList(<%= index -%>, $j('#sids'))"><img src="<%= ApplicationController.root_context -%>/images/controls/cross.png" title="<%= message('comparison.remove_resource') -%>"/></a></div>
                   <a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= s.resource.key -%>"><%= s.resource.name(true) -%></a>
                   <br/>
                   <span class="note"><b><%= s.event(EventCategory::KEY_VERSION).name -%></b></span>
                   <br/>
                   <span class="note"><%= human_short_date s.created_at -%></span>
+                  <div style="width: 100%; text-align: center;"><a href="#" onclick="removeFromList(<%= index -%>, $j('#sids'))"><img src="<%= ApplicationController.root_context -%>/images/controls/cross.png" title="<%= message('comparison.remove_resource') -%>"/></a></div>
                 </td>
-                <td class="thin" style="vertical-align: top;">
+                <td class="thin" style="vertical-align: bottom;">
                   <% if index < last_index %>
                     <a href="#" onclick="moveRight(<%= index -%>)"><img src="<%= ApplicationController.root_context -%>/images/controls/move_right.png" title="<%= message('comparison.move_right') -%>"/></a>
                   <% else %>
             </script>
           </span>  
         </th>
-        
-        <th class="thin" style="vertical-align: top">
-          <a href="<%= url_for :controller => 'comparison', :action => 'index', :sids => @snapshots.map {|s| s.id.to_s}.join(','), :metrics => @metrics.map {|m| m.key}.join(',') -%>">
-            <img src="<%= ApplicationController.root_context -%>/images/permalink.png" title="<%= message('permalink') -%>"/>
-          </a>
-        </th>
       </thead>
         
       <tbody>
             <% end %>
             
             <td></td>
-            <td></td>
           </tr>
         <% end %> 
       </tbody>
index f84fe5e4911c3d9c4277ef48d3ff40ecefecc0a7..6877f148f05d6a14d31f9e8960d8315377740fc6 100644 (file)
@@ -1,5 +1,13 @@
 <% if @breadcrumbs %>
+
   <div id="crumbs">
+    <% if @permalink %>
+      <ul id="crumbs-ops">
+        <li>
+          <a href="<%= @permalink -%>"><img src="<%= ApplicationController.root_context -%>/images/permalink.png" width="16" height="16" title="<%= message('permalink') -%>"/></a>
+        </li>
+      </ul>
+    <% end %>
     <ul id="bc">
       <%
          @breadcrumbs.each_with_index do |breadcrumb, index|
       <% end %>
     </ul>
   </div>
+  
 <% elsif @resource || @project
      displayed_resource = @resource || @project
 %>
+
   <div id="crumbs">
     <% if !@review %>
       <ul id="crumbs-ops">
@@ -76,4 +86,5 @@
       %>
     </ul>
   </div>
+
 <% end %>
\ No newline at end of file