#
class ComparisonController < ApplicationController
-
+
def index
snapshots = []
resource_key = params[:resource]
@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
<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>
<% 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">
%>
</ul>
</div>
+
<% end %>
\ No newline at end of file