mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-19 07:26:10 +01:00
Extract chart value object
This simplifies the views (slightly).
This commit is contained in:
parent
8b0f3e986a
commit
0aa6ea183b
7 changed files with 65 additions and 41 deletions
|
|
@ -7,28 +7,13 @@
|
|||
<%= t('stats.actions_avg_created', :count => (@sum_actions_created_last12months*10.0/12.0).round/10.0 )%>
|
||||
<%= t('stats.actions_avg_completed', :count => (@sum_actions_done_last12months*10.0/12.0).round/10.0 )%></p>
|
||||
|
||||
<%
|
||||
%w{
|
||||
actions_done_last30days_data
|
||||
actions_done_last12months_data
|
||||
actions_completion_time_data
|
||||
}.each do |action|
|
||||
%><%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => action)} -%><%
|
||||
end
|
||||
%>
|
||||
<% @completion_charts.each do |chart| %><%=
|
||||
render :partial => 'chart', :locals => {:chart => chart}
|
||||
-%><% end %>
|
||||
|
||||
<br style="clear:both">
|
||||
|
||||
<%
|
||||
%w{
|
||||
actions_visible_running_time_data
|
||||
actions_running_time_data
|
||||
actions_open_per_week_data
|
||||
actions_day_of_week_all_data
|
||||
actions_day_of_week_30days_data
|
||||
actions_time_of_day_all_data
|
||||
actions_time_of_day_30days_data
|
||||
}.each do |action|
|
||||
%><%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => action)} -%><%
|
||||
end
|
||||
%>
|
||||
<% @timing_charts.each do |chart| %><%=
|
||||
render :partial => 'chart', :locals => {:chart => chart}
|
||||
-%><% end %>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<% @swf_count ||= 0 -%>
|
||||
<div class="open-flash-chart"><%= swf_tag asset_path("open-flash-chart.swf"),
|
||||
:flashvars => { 'width' => width, 'height' => height, 'data' => data},
|
||||
:flashvars => { 'width' => chart.width, 'height' => chart.height, 'data' => url_for(:action => chart.action)},
|
||||
:parameters => { 'allowScriptAccess' => 'sameDomain', 'wmode' => 'transparent'},
|
||||
:div_id => "chart_#{@swf_count+=1}",
|
||||
:size => "#{width}x#{height}" %></div>
|
||||
:size => chart.dimensions %></div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<%= render :partial => 'chart', :locals => {:width => @pie_width, :height => @pie_height, :data => url_for(:action => 'context_total_actions_data')} -%>
|
||||
|
||||
<%= render :partial => 'chart', :locals => {:width => @pie_width, :height => @pie_height, :data => url_for(:action => 'context_running_actions_data')} -%>
|
||||
<% @context_charts.each do |chart| %><%=
|
||||
render :partial => 'chart', :locals => {:chart => chart}
|
||||
-%><% end %>
|
||||
|
||||
<br style="clear:both">
|
||||
|
||||
|
|
@ -34,4 +34,4 @@
|
|||
<br/><%
|
||||
end
|
||||
-%>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => :actions_done_lastyears_data)} -%>
|
||||
<%= render :partial => 'chart', :locals => {:chart => @chart} -%>
|
||||
<%= raw t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), stats_path)) %>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => @chart_name)} -%>
|
||||
<%= render :partial => 'chart', :locals => {:chart => @chart} -%>
|
||||
<br/>
|
||||
<p>
|
||||
<%= t('stats.click_to_update_actions') %> <%= raw t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), stats_path)) %>
|
||||
|
|
@ -22,4 +22,4 @@
|
|||
</div>
|
||||
<%= render :partial => "todos/todo", :collection => @selected_actions, :locals => { :parent_container_type => 'stats' } %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue