mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-26 10:46:10 +01:00
This fixes a bug where if you have fewer than 10 projects, your top 10 projects were listed as: 6 - n/a (n/a) 6 - n/a (n/a) 6 - n/a (n/a) 6 - n/a (n/a) rather than 7 - n/a (n/a) 8 - n/a (n/a) 9 - n/a (n/a) 10 - n/a (n/a)
38 lines
1.3 KiB
Text
Executable file
38 lines
1.3 KiB
Text
Executable file
<div class="stats_module">
|
|
<h3><%= t('stats.top10_projects') %></h3>
|
|
<% i=0
|
|
@projects_and_actions.each do |p|
|
|
i+=1 -%>
|
|
<%= i -%> - <%= link_to p.name, {:controller => "projects", :action => "show", :id => p.id}%> (<%=p.count %> <%= t('common.actions_midsentence', :count => p.count) %>) <br/>
|
|
<% end
|
|
if i < 10
|
|
(i+1).upto 10 do |j| -%>
|
|
<%= j -%> - <%=t('common.not_available_abbr')%> (<%=t('common.not_available_abbr')%>) <br/>
|
|
<% end
|
|
end
|
|
-%>
|
|
</div>
|
|
|
|
<div class="stats_module">
|
|
<h3><%= t('stats.top10_projects_30days') %></h3>
|
|
<% i=0
|
|
@projects_and_actions_last30days.each do |p|
|
|
i+=1 -%>
|
|
<%= i -%> - <%= link_to p.name, {:controller => "projects", :action => "show", :id => p.id} %> (<%=p.count %> <%= t('common.actions_midsentence', :count => p.count) %>) <br/>
|
|
<% end
|
|
if i < 10
|
|
(i+1).upto 10 do |j| -%>
|
|
<%= j -%> - <%=t('common.not_available_abbr')%> (<%=t('common.not_available_abbr')%>) <br/>
|
|
<% end
|
|
end
|
|
-%>
|
|
</div>
|
|
|
|
<div class="stats_module">
|
|
<h3><%= t('stats.top10_longrunning') %></h3>
|
|
<% i=0
|
|
@projects_and_runtime.each do |id, name, days|
|
|
i+=1 -%>
|
|
<%= i -%> - <%= link_to name, {:controller => "projects", :action => "show", :id => id} %> (<%=days %> <%= t('common.days_midsentence', :count => days) %>) <br/>
|
|
<% end -%>
|
|
</div>
|