#
#
def link_to_resource(resource, name=nil, options={})
+ period_index=options[:period]
+ 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}}, :title => options[:title])
+ link_to(name || resource.name, {:overwrite_params => {:controller => 'dashboard', :action => 'index', :id => (resource.copy_resource_id||resource.id), :period => period_index}}, :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}}, :title => options[:title])
+ link_to(name || resource.name, {:overwrite_params => {:id => (resource.copy_resource_id||resource.id), :period => period_index}}, :title => options[:title])
end
else
- link_to(name || resource.name, {:controller => 'resource', :action => 'index', :id => resource.id}, :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}, :popup => ['resource', 'height=800,width=900,scrollbars=1,resizable=1'], :title => options[:title])
end
end
<% filter=@filter_context.filter %>
<div>
+<% unless edit_mode %>
<div class="line-block">
<div class="operations">
<form action="<%= url_for :overwrite_params => {:period => nil} -%>" style="display: inline" method="get">
</form>
</div>
</div>
-
+<% end %>
<table class="data nowrap width100" id="results">
<thead id="results-head">
<tr>
<% end %>
<% end %>
<% elsif column.on_name? %>
- <%= qualifier_icon(snapshot) %> <%= link_to_resource(snapshot.project, snapshot.project.name(true), {:dashboard => true, :title => snapshot.project.key}) %>
+ <%= qualifier_icon(snapshot) %> <%= link_to_resource(snapshot.project, snapshot.project.name(true), {:dashboard => true, :title => snapshot.project.key, :period => @filter_context.period_index}) %>
<% elsif column.on_version? %><%= h snapshot.version %>
<% elsif column.on_language? %><%= snapshot.project.language %>
<% elsif column.on_date? %><%= human_short_date(snapshot.created_at) %>
-<%
-metrics=treemap_metrics(@filter)
-size_metric=metrics[0]
-color_metric=metrics[1]
-%>
-<div id="treemap_loading">
- <%= image_tag 'loading.gif' %>
-</div>
-<div id="treemap"> </div>
-<script>
-var treemap_width = $('treemap').getDimensions().width - 15;
-var treemap_height = document.viewport.getDimensions().height - 220;
-function load_treemap(size_metric, color_metric, hide_form, period_index) {
- $('treemap_loading').show();
- $('treemap').hide();
- <%= remote_function :update => 'treemap', :url => {:action => 'treemap', :id => @filter.id, :show_periods => true},
- :complete => "$('treemap_loading').hide();$('treemap').show();",
- :with => "'width=' + treemap_width + '&height=' + treemap_height + '&size_metric=' + size_metric + '&color_metric=' + color_metric + '&hide_form=' + hide_form + '&period=' + period_index" %>
-}
-load_treemap('<%= size_metric.key -%>', '<%= color_metric.key -%>', <%= edit_mode -%>, <%= params[:period].to_i -%>);
-</script>
\ No newline at end of file
+<% if @filter.period? %>
+Treemap does not support yet the selection of a period.
+
+<% else %>
+ <%
+ metrics=treemap_metrics(@filter)
+ size_metric=metrics[0]
+ color_metric=metrics[1]
+ %>
+ <div id="treemap_loading">
+ <%= image_tag 'loading.gif' %>
+ </div>
+ <div id="treemap"> </div>
+ <script>
+ var treemap_width = $('treemap').getDimensions().width - 15;
+ var treemap_height = document.viewport.getDimensions().height - 220;
+ function load_treemap(size_metric, color_metric, hide_form, period_index) {
+ $('treemap_loading').show();
+ $('treemap').hide();
+ <%= remote_function :update => 'treemap', :url => {:action => 'treemap', :id => @filter.id, :show_periods => true},
+ :complete => "$('treemap_loading').hide();$('treemap').show();",
+ :with => "'width=' + treemap_width + '&height=' + treemap_height + '&size_metric=' + size_metric + '&color_metric=' + color_metric + '&hide_form=' + hide_form + '&period=' + period_index" %>
+ }
+ load_treemap('<%= size_metric.key -%>', '<%= color_metric.key -%>', <%= edit_mode -%>, <%= params[:period].to_i -%>);
+ </script>
+<% end %>
\ No newline at end of file
<tr>
<td class="first">Criteria:</td>
<td>
- <%= render :partial => 'filters/criterion', :locals => {:id => '0', :criterion => (@filter.measure_criteria.size>0 ? @filter.measure_criteria[0] : nil)} %>
+ <%= render :partial => 'filters/criterion', :locals => {:id => '0', :criterion => (@filter.measure_criteria.size>0 ? @filter.measure_criteria[0] : nil)} %>
</td>
</tr>
<tr>
- <td class="first"></td>
+ <td class="first">and: </td>
<td>
- and <%= render :partial => 'filters/criterion', :locals => {:id => '1', :criterion => (@filter.measure_criteria.size>1 ? @filter.measure_criteria[1] : nil) } %>
+ <%= render :partial => 'filters/criterion', :locals => {:id => '1', :criterion => (@filter.measure_criteria.size>1 ? @filter.measure_criteria[1] : nil) } %>
</td>
</tr>
<tr>
- <td class="first"></td>
+ <td class="first">and: </td>
<td>
- and <%= render :partial => 'filters/criterion', :locals => {:id => '2', :criterion => (@filter.measure_criteria.size>2 ? @filter.measure_criteria[2] : nil) } %>
+ <%= render :partial => 'filters/criterion', :locals => {:id => '2', :criterion => (@filter.measure_criteria.size>2 ? @filter.measure_criteria[2] : nil) } %>
</td>
</tr>
<% unless @filter.advanced_search? %>