mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-16 17:26:33 +01:00
Merge pull request #168 from kytrinyx/stats-actions
Encapsulate the stats for actions on the stats index page
This commit is contained in:
commit
1e3782ce67
7 changed files with 246 additions and 65 deletions
|
|
@ -1,19 +1,17 @@
|
|||
<p><%= t('stats.actions_avg_completion_time', :count => (@actions_avg_ttc*10).round/10.0) %>
|
||||
<%= t('stats.actions_min_max_completion_days', :max => (@actions_max_ttc*10).round/10.0, :min => (@actions_min_ttc*10).round/10.0) %>
|
||||
<%= t('stats.actions_min_completion_time', :time => @actions_min_ttc_sec) %></p>
|
||||
<%= render :partial => 'time_to_complete', :locals => {:ttc => actions.ttc} -%>
|
||||
|
||||
<p><%= t('stats.actions_actions_avg_created_30days', :count => (@sum_actions_created_last30days*10.0/30.0).round/10.0 )%>
|
||||
<%= t('stats.actions_avg_completed_30days', :count => (@sum_actions_done_last30days*10.0/30.0).round/10.0 )%>
|
||||
<%= 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>
|
||||
<p><%= t('stats.actions_actions_avg_created_30days', :count => (actions.created_last30days*10.0/30.0).round/10.0 )%>
|
||||
<%= t('stats.actions_avg_completed_30days', :count => (actions.done_last30days*10.0/30.0).round/10.0 )%>
|
||||
<%= t('stats.actions_avg_created', :count => (actions.created_last12months*10.0/12.0).round/10.0 )%>
|
||||
<%= t('stats.actions_avg_completed', :count => (actions.done_last12months*10.0/12.0).round/10.0 )%></p>
|
||||
|
||||
<% @completion_charts.each do |chart| %><%=
|
||||
<% actions.completion_charts.each do |chart| %><%=
|
||||
render :partial => 'chart', :locals => {:chart => chart}
|
||||
-%><% end %>
|
||||
|
||||
<br style="clear:both">
|
||||
|
||||
<% @timing_charts.each do |chart| %><%=
|
||||
<% actions.timing_charts.each do |chart| %><%=
|
||||
render :partial => 'chart', :locals => {:chart => chart}
|
||||
-%><% end %>
|
||||
|
||||
|
|
|
|||
4
app/views/stats/_time_to_complete.html.erb
Normal file
4
app/views/stats/_time_to_complete.html.erb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
<p><%= t('stats.actions_avg_completion_time', :count => ttc.avg) %>
|
||||
<%= t('stats.actions_min_max_completion_days', :max => ttc.max, :min => ttc.min) %>
|
||||
<%= t('stats.actions_min_completion_time', :time => ttc.min_sec) %></p>
|
||||
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<% unless current_user.todos.empty? -%>
|
||||
|
||||
<h2><%= t('stats.actions') %></h2>
|
||||
<%= render :partial => 'actions' -%>
|
||||
<%= render :partial => 'actions', :locals => {:actions => @actions} -%>
|
||||
|
||||
<h2><%= t('stats.contexts') %></h2>
|
||||
<%= render :partial => 'contexts' -%>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue