mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-02 06:01:47 +01:00
Apply lrbalt's patch to cleanup a couple of stats issues. Fixes #558 and #559. Thanks Rob and lrbalt!
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@591 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
6e0e02714f
commit
b450d1026d
4 changed files with 1 additions and 48 deletions
|
|
@ -477,7 +477,7 @@ class StatsController < ApplicationController
|
|||
" datediff(now(), t.completed_at) < 30) "+
|
||||
"AND p.user_id="+@user.id.to_s+" "+
|
||||
"GROUP BY p.id "+
|
||||
"ORDER BY count DESC" +
|
||||
"ORDER BY count DESC " +
|
||||
"LIMIT 10"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ and completed on average <%=@sum_actions_done_last12months/12%> actions per mont
|
|||
actions_running_time_data
|
||||
actions_day_of_week_all_data
|
||||
actions_day_of_week_30days_data
|
||||
actions_day_of_week_30days_data
|
||||
actions_time_of_day_all_data
|
||||
actions_time_of_day_30days_data
|
||||
}.each do |action|
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
&title=Actions completed in the last 12 months,16,&
|
||||
&y_legend=Number of actions,12,0x736AFF&
|
||||
&x_legend=Months ago,12,0x736AFF&
|
||||
&y_ticks=5,10,5&
|
||||
&filled_bar=50,0x9933CC,0x8010A0&
|
||||
&line_2=3,0xFF0000&
|
||||
&values=
|
||||
<% 0.upto 11 do |i| -%>
|
||||
<%= @actions_done_last12months_hash[i.to_s]%>,
|
||||
<% end -%><%= @actions_done_last12months_hash["12"]%>&
|
||||
&values_2=<%0.upto 11 do |i| -%><%=@sum_actions_done_last12months/12-%>,<%end-%><%=@sum_actions_done_last12months/12-%>&
|
||||
&x_labels=<%0.upto 11 do |i| -%>
|
||||
<%= Date::MONTHNAMES[ (Time.now.mon - i -1 ) % 12 + 1 ] -%>,
|
||||
<% end -%>
|
||||
<%= Date::MONTHNAMES[(Time.now.mon - 12 -1 ) % 12 + 1] -%>&
|
||||
&y_min=0&
|
||||
&y_max=<%=@max-%>&
|
||||
&x_label_style=9,,2,&
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
&title=Actions completed in the last 30 days,16,&
|
||||
&y_legend=Number of actions,12,0x736AFF&
|
||||
&x_legend=Number of days ago,12,0x736AFF&
|
||||
&y_ticks=5,10,5&
|
||||
&filled_bar=50,0x9933CC,0x8010A0&
|
||||
&line_2=3,0xFF0000&
|
||||
&values=
|
||||
<% 0.upto 29 do |i| -%>
|
||||
<%= @actions_done_last30days_hash[i.to_s]%>,
|
||||
<% end -%><%= @actions_done_last30days_hash["30"]%>&
|
||||
&values_2=
|
||||
<%0.upto 29 do |i| -%>
|
||||
<%=@sum_actions_done_last30days/30-%>,
|
||||
<%end-%>
|
||||
<%=@sum_actions_done_last30days/30-%>&
|
||||
&x_labels=
|
||||
<%0.upto 29 do |i|
|
||||
seconds = i * 24 * 60 * 60
|
||||
delta = Time.now-seconds
|
||||
-%>
|
||||
<%= delta.strftime("%a %d-%m") -%>,
|
||||
<% end
|
||||
seconds = 29*25*60*60
|
||||
delta = Time.now-seconds-%>
|
||||
<%= delta.strftime("%a %d-%m") -%>&
|
||||
&y_min=0&
|
||||
&y_max=<%=@max -%>&
|
||||
&x_label_style=9,,2,3&
|
||||
Loading…
Add table
Add a link
Reference in a new issue