Changed code to support basic i18n.

Added RubyMine configuration and rvm setup to .gitignore.
This commit is contained in:
Marcus Ilgner 2010-10-31 21:27:13 +08:00 committed by Reinier Balt
parent 04faa5d408
commit fd3f69d927
99 changed files with 1157 additions and 601 deletions

View file

@ -1,11 +1,11 @@
<p>Of all your completed actions, the average time to complete is <%= (@actions_avg_ttc*10).round/10.0 %> days.
The Max-/minimum days to complete is <%= (@actions_max_ttc*10).round/10.0%>/<%= (@actions_min_ttc*10).round/10.0 %>.
The minimum time to complete is <%= @actions_min_ttc_sec %></p>
<p><%= t('stats.actions_avg_completion_time', :count => (@actions_avg_ttc*10).round/10.0) %>
<%= t('stats.actions_min_max_completion_days', :min=> (@actions_max_ttc*10).round/10.0, :max => (@actions_min_ttc*10).round/10.0) %>
<%= t('stats.actions_min_completion_time', :time => @actions_min_ttc_sec) %></p>
<p>In the last 30 days you created on average <%=(@sum_actions_created_last30days*10.0/30.0).round/10.0 %> actions
and completed on average <%=(@sum_actions_done_last30days*10.0/30.0).round/10.0%> actions per day.
In the last 12 months you created on average <%=(@sum_actions_created_last12months*10.0/12.0).round/10.0 %> actions
and completed on average <%= (@sum_actions_done_last12months*10.0/12.0).round/10.0%> actions per month.</p>
<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>
<% %w{ actions_done_last30days_data
actions_done_last12months_data

View file

@ -5,7 +5,7 @@
<br style="clear:both">
<div class="stats_module">
<h3>Top 5 Contexts</h3>
<h3><%= t('stats.top5_contexts') %></h3>
<%
1.upto 5 do |i|
%><%=i-%> -
@ -19,7 +19,7 @@
</div>
<div class="stats_module">
<h3>Top 5 Visible Contexts with incomplete actions</h3>
<h3><%= t('stats.top5_visible_contexts_with_incomplete_actions') %></h3>
<%
1.upto 5 do |i|
%><%=i-%> -

View file

@ -1,5 +1,5 @@
<div class="stats_module">
<h3>Top 10 projects</h3>
<h3><%= t('stats.top10_projects') %></h3>
<% i=0
@projects_and_actions.each do |p|
i+=1 -%>
@ -14,7 +14,7 @@
</div>
<div class="stats_module">
<h3>Top 10 project in past 30 days</h3>
<h3><%= t('stats.top10_projects_30days') %></h3>
<% i=0
@projects_and_actions_last30days.each do |p|
i+=1 -%>
@ -29,7 +29,7 @@
</div>
<div class="stats_module">
<h3>Top 10 longest running projects</h3>
<h3><%= t('stats.top10_longrunning') %></h3>
<% i=0
@projects_and_runtime.each do |id, name, days|
i+=1 -%>

View file

@ -1,10 +1,10 @@
<div class="stats_module">
<h3>Tag Cloud for all actions</h3>
<p>This tag cloud includes tags of all actions (completed, not completed, visible and/or hidden)</p>
<h3><%= t('stats.tag_cloud_title') %></h3>
<p><%= t('stats.tag_cloud_description') %></p>
<p>
<% if @tags_for_cloud.size < 1
%> no tags available <%
t('stats.no_tags_available')
else
@tags_for_cloud.each do |t| %>
<%= link_to t.name,
@ -18,12 +18,11 @@
</div>
<div class="stats_module">
<h3>Tag Cloud actions in past 90 days</h3>
<p>This tag cloud includes tags of actions that were created or completed in
the past 90 days.</p>
<h3><%= t('stats.tag_cloud_90days_title') %></h3>
<p><%= t('stats.tag_cloud_90days_description') %></p>
<p>
<% if @tags_for_cloud_90days.size < 1
%> no tags available <%
t('stats.no_tags_available')
else
@tags_for_cloud_90days.each do |t| %>
<%= link_to t.name,

View file

@ -1,23 +1,23 @@
<p>You have <%= @projects.count%> projects.
Of those <%= @projects.active.count%> are active projects,
<%= @projects.hidden.count%> hidden projects and
<%= @projects.completed.count%> completed projects</p>
<p><%= t('stats.totals_project_count', :count => @projects.count) %>
<%= t('stats.totals_active_project_count', :count => @projects.active.count) %>,
<%= t('stats.totals_hidden_project_count', :count => @projects.hidden.count) %>
<%= t('stats.totals_completed_project_count', :count => @projects.completed.count) %></p>
<p>You have <%= @contexts.count%> contexts.
Of those <%= @contexts.active.count%> are visible contexts and
<%= @contexts.hidden.count%> are hidden contexts
<p><%= t('stats.totals_context_count', :count => @contexts.count ) %>
<%= t('stats.totals_visible_context_count', :count => @contexts.active.count) %>
<%= t('stats.totals_hidden_context_count', :count => @contexts.hidden.count) %>
<% unless @actions.empty? -%>
<p>Since your first action on <%= format_date(@first_action.created_at) %>
you have a total of <%= @actions.count %> actions.
<%= @actions.completed.count %> of these are completed.
<p><%= t('stats.totals_first_action', :date => format_date(@first_action.created_at)) %>
<%= t('stats.totals_action_count', :count => @actions.count) %>,
<%= t('stats.totals_actions_completed', :count => @actions.completed.count) %>
<p>You have <%= @actions.not_completed.count %> incomplete actions
of which <%= @actions.deferred.count %> are deferred actions
in the tickler and <%= @actions.blocked.count %> are dependent on the completion of other actions.
<p><%= t('stats.totals_incomplete_actions', :count => @actions.not_completed.count) %>
<%= t('stats.totals_deferred_actions', :count => @actions.deferred.count) %>
<%= t('stats.totals_blocked_actions', :count => @actions.blocked.count) %>
</p>
<p>You have <%= @tags_count-%> tags placed on actions. Of those tags,
<%= @unique_tags_count -%> are unique.
<p><%= t('stats.totals_tag_count', :count => @tags_count) %>
<%= t('stats.totals_unique_tags', :count => @unique_tags_count) %>
<% end -%>

View file

@ -1,7 +1,7 @@
&title=Completion time (all completed actions),{font-size:16},&
&y_legend=Actions,10,0x8010A0&
&y2_legend=Percentage,10,0xFF0000&
&x_legend=Running time of an action (weeks),12,0x736AFF&
&title=<%= t('stats.action_completion_time_title') %>,{font-size:16},&
&y_legend=<%= t('stats.legend.actions') %>,10,0x8010A0&
&y2_legend=<%= t('stats.legend.percentage') %>,10,0xFF0000&
&x_legend=<%= t('stats.legend.running_time') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0&
&values=

View file

@ -1,9 +1,9 @@
&title=Day of week (past 30 days),{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Day of week,12,0x736AFF&
&title=<%= t('stats.actions_dow_30days_title') %>,{font-size:16},&
&y_legend=<%= t('stats.actions_dow_30days_legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.actions_dow_30days_legend.day_of_week') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,8&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,8&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created') %>,8&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,8&
&values=<%
0.upto 5 do |i| -%>
<%=@actions_creation_day_array[i] -%>,

View file

@ -1,9 +1,9 @@
&title=Day of week (all actions),{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Day of week,12,0x736AFF&
&title=<%= t('stats.actions_day_of_week_title') %>,{font-size:16},&
&y_legend=<%= t('stats.actions_day_of_week_legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.actions_day_of_week_legend.day_of_week') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,8&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,8&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created')%>,8&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,8&
&values=<%
0.upto 5 do |i| -%>
<%=@actions_creation_day_array[i] -%>,

View file

@ -1,13 +1,13 @@
&title=Actions in the last 12 months,{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Months ago,12,0x736AFF&
&title=<%= t('stats.actions_lastyear_title') %>,{font-size:16},&
&y_legend=<%= t('stats.legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.legend.months_ago') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,9&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,9&
&line_3=2,0x00FF00, Avg Created, 9&
&line_4=2,0xFF0000, Avg Completed, 9&
&line_5=2,0x007700, 3 Month Avg Created, 9&
&line_6=2,0xAA0000, 3 Month Avg Completed, 9&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created')%>,9&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,9&
&line_3=2,0x00FF00, <%= t('stats.labels.avg_created') %>, 9&
&line_4=2,0xFF0000, <%= t('stats.labels.avg_completed') %>, 9&
&line_5=2,0x007700, <%= t('stats.labels.month_avg_created', :months => 3) %>, 9&
&line_6=2,0xAA0000, <%= t('stats.labels.month_avg_completed', :months => 3) %>, 9&
&line_7=1,0xAA0000&
&line_8=1,0x007700&
&values=<% 0.upto 11 do |i| -%><%= @actions_created_last12months_hash[i]%>,<% end -%><%= @actions_created_last12months_hash[12]%>&

View file

@ -1,11 +1,11 @@
&title=Actions in the last 30 days,{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Number of days ago,12,0x736AFF&
&title=<%= t('stats.actions_30days_title') %>,{font-size:16},&
&y_legend=<%= t('stats.legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.legend.number_of_days') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,9&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,9&
&line_3=3,0x00FF00, Avg Created, 9&
&line_4=3,0xFF0000, Avg Completed, 9&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created') %>,9&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,9&
&line_3=3,0x00FF00, <%= t('stats.labels.avg_created') %>, 9&
&line_4=3,0xFF0000, <%= t('stats.labels.avg_completed') %>, 9&
&values=
<% 0.upto 29 do |i| -%>
<%= @actions_created_last30days_hash[i]%>,

View file

@ -1,2 +1,2 @@
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => :actions_done_lastyears_data)} -%>
Click <%=link_to "here", {:controller => "stats", :action => "index"} %> to return to the statistics page.
<%= t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), {:controller => "stats", :action => "index"})) %>

View file

@ -1,13 +1,13 @@
&title=Actions in the last years,{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Months ago,12,0x736AFF&
&title=<%= t('stats.actions_last_year') %>,{font-size:16},&
&y_legend=<%= t('stats.actions_last_year_legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.actions_last_year_legend.months_ago') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,9&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,9&
&line_3=2,0x00FF00, Avg Created, 9&
&line_4=2,0xFF0000, Avg Completed, 9&
&line_5=2,0x007700, 3 Month Avg Created, 9&
&line_6=2,0xAA0000, 3 Month Avg Completed, 9&
&line_3=2,0x00FF00, <%= t('stats.labels.avg_created') %>, 9&
&line_4=2,0xFF0000, <%= t('stats.labels.avg_completed') %>, 9&
&line_5=2,0x007700, <%= t('stats.labels.month_avg_created', :months => 3) %>, 9&
&line_6=2,0xAA0000, <%= t('stats.labels.month_avg_completed', :months => 3) %>, 9&
&line_7=1,0xAA0000&
&line_8=1,0x007700&
&values=<% 0.upto @month_count-1 do |i| -%><%= @actions_created_last_months_hash[i]%>,<% end -%><%= @actions_created_last_months_hash[@month_count]%>&

View file

@ -1,7 +1,7 @@
&title=Current running time of all incomplete actions,{font-size:16},&
&y_legend=Actions,10,0x736AFF&
&y2_legend=Percentage,10,0xFF0000&
&x_legend=Running time of an action (weeks). Click on a bar for more info,11,0x736AFF&
&title=<%= t('stats.running_time_all') %>,{font-size:16},&
&y_legend=<%= t('stats.running_time_all_legend.actions') %>",10,0x736AFF&
&y2_legend=<%= t('stats.running_time_all_legend.percentage') %>,10,0xFF0000&
&x_legend=<%= t('stats.running_time_all_legend.running_time') %>,11,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0&
&values=

View file

@ -1,9 +1,9 @@
&title=Time of day (last 30 days),{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Time of Day,12,0x736AFF&
&title=<%= t('stats.tod30') %>,{font-size:16},&
&y_legend=<%= t('stats.tod30_legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.tod30_legend.time_of_day') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,8&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,8&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created') %>,8&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,8&
&values=<%
0.upto 22 do |i| -%>
<%=@actions_creation_hour_array[i] -%>,

View file

@ -1,9 +1,9 @@
&title=Time of day (all actions),{font-size:16},&
&y_legend=Number of actions,12,0x736AFF&
&x_legend=Time of Day,12,0x736AFF&
&title=<%= t('stats.time_of_day') %>,{font-size:16},&
&y_legend=<%= t('stats.time_of_day_legend.number_of_actions') %>,12,0x736AFF&
&x_legend=<%= t('stats.time_of_day_legend.time_of_day') %>,12,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0,Created,8&
&filled_bar_2=50,0x0066CC,0x0066CC,Completed,8&
&filled_bar=50,0x9933CC,0x8010A0,<%= t('stats.labels.created') %>,8&
&filled_bar_2=50,0x0066CC,0x0066CC,<%= t('stats.labels.completed') %>,8&
&values=<%
0.upto 22 do |i| -%>
<%=@actions_creation_hour_array[i] -%>,

View file

@ -1,7 +1,7 @@
&title=Current running time of incomplete visible actions,{font-size:16},&
&y_legend=Actions,10,0x736AFF&
&y2_legend=Percentage,10,0xFF0000&
&x_legend=Running time of an action (weeks). Click on a bar for more info,11,0x736AFF&
&title=<%= t('stats.current_running_time_of_incomplete_visible_actions') %>,{font-size:16},&
&y_legend=<%= t('stats.running_time_legend.actions') %>,10,0x736AFF&
&y2_legend=<%= t('stats.running_time_legend.percentage') %>,10,0xFF0000&
&x_legend=<%= t('stats.running_time_legend.weeks') %>,11,0x736AFF&
&y_ticks=5,10,5&
&filled_bar=50,0x9933CC,0x8010A0&
&values=

View file

@ -1,4 +1,4 @@
&title=Spread of running actions for visible contexts,{font-size:16}&
&title=<%= t('stats.spread_of_running_actions_for_visible_contexts') %>,{font-size:16}&
&pie=60,#505050,{font-size: 12px; color: #404040;}&
&x_axis_steps=1& &y_ticks=5,10,5& &line=3,#87421F& &y_min=0& &y_max=20&
&values=<%

View file

@ -1,4 +1,4 @@
&title=Spread of actions for all context,{font-size:16}&
&title=<%= t('stats.spread_of_actions_for_all_context') %>,{font-size:16}&
&pie=70,#505050,{font-size: 12px; color: #404040;}&
&x_axis_steps=1& &y_ticks=5,10,5& &line=3,#87421F& &y_min=0& &y_max=20&
&values=<%

View file

@ -1,29 +1,29 @@
<div class="stats_content">
<h2>Totals</h2>
<h2><%= t('stats.totals') %></h2>
<%= render :partial => 'totals' -%>
<% unless @actions.empty? -%>
<h2>Actions</h2>
<h2><%= t('stats.actions') %></h2>
<%= render :partial => 'actions' -%>
<h2>Contexts</h2>
<h2><%= t('stats.contexts') %></h2>
<%= render :partial => 'contexts' -%>
<h2>Projects</h2>
<h2><%= t('stats.projects') %></h2>
<%= render :partial => 'projects' -%>
<h2>Tags</h2>
<h2><%= t('stats.tags') %></h2>
<%= render :partial => 'tags' -%>
<% else -%>
<p>More statistics will appear here once you have added some actions.</p>
<p><%= t('stats.more_stats_will_appear') %></p>
<% end -%>

View file

@ -1,17 +1,15 @@
<%= render :partial => 'chart', :locals => {:width => @chart_width, :height => @chart_height, :data => url_for(:action => @chart_name)} -%>
<br/>
<p>Click on a bar in the chart to update the actions below. Click <%=link_to "here", {:controller => "stats", :action => "index"} %> to return to the statistics page. <%
unless @further -%> <%=
"Click " +
link_to("here", {:controller => "stats", :action => "show_selected_actions_from_chart", :id=>"#{params[:id]}_end", :index => params[:index]})+
" to show the actions from week " + params[:index] + " and further." -%>
<p><%= t('stats.click_to_update_actions') %> <%= t('stats.click_to_return', :link => link_to(t('stats.click_to_return_link'), {:controller => "stats", :action => "index"})) %> <%
unless @further -%> <%=
t('stats.click_to_show_actions_from_week', :link => link_to("here", {:controller => "stats", :action => "show_selected_actions_from_chart", :id=>"#{params[:id]}_end", :index => params[:index]}), :week => params[:index]) -%>
<% end %></p>
<br/>
<div class="container tickler" id="tickler_container">
<h2><%= @page_title -%></h2>
<div id="tickler" class="items toggle_target">
<div id="tickler-empty-nd" style="display:<%= @selected_actions.empty? ? 'block' : 'none'%>;">
<div class="message"><p>There are no actions selected</p></div>
<div class="message"><p><%= t('stats.no_actions_selected') %></p></div>
</div>
<%= render :partial => "todos/todo", :collection => @selected_actions, :locals => { :parent_container_type => 'stats' } %>
</div>