mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-03 22:41:48 +01:00
Fixed #593, where the stats page failed to render if the user has no actions. Thanks to SK for the bug report.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@629 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
6156f26c47
commit
71010ff681
2 changed files with 15 additions and 1 deletions
|
|
@ -7,11 +7,16 @@
|
|||
Of those <%= @contexts.count(:conditions => ["hide = ?", false])%> are visible contexts and
|
||||
<%= @contexts.count(:conditions => ["hide = ?", true]) %> are hidden contexts
|
||||
|
||||
<% unless @actions.count == 0 -%>
|
||||
<p>You have <%= @actions.count(:conditions => "completed_at IS NULL") %> uncompleted actions of which
|
||||
<%= @actions.count(:conditions => "completed_at IS NULL AND NOT show_from IS NULL") %> are
|
||||
deferred actions. </p>
|
||||
|
||||
<p>Since your first action on <%= format_date(@first_action.created_at) %> you have
|
||||
a total of <%= @actions.count %> actions.
|
||||
<%= @actions.count(:conditions => "NOT completed_at IS NULL") %> of these are completed.
|
||||
|
||||
<p>You have <%= @tags.count-%> tags placed on actions. Of those tags,
|
||||
<%= @unique_tags.size -%> are unique.
|
||||
<%= @unique_tags.size -%> are unique.
|
||||
<% end -%>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
<%= render :partial => 'totals' -%>
|
||||
|
||||
<% unless @actions.count == 0 -%>
|
||||
|
||||
<h2>Actions</h2>
|
||||
|
||||
<%= render :partial => 'actions' -%>
|
||||
|
|
@ -18,4 +20,11 @@
|
|||
<h2>Tags</h2>
|
||||
|
||||
<%= render :partial => 'tags' -%>
|
||||
|
||||
<% else -%>
|
||||
|
||||
<p>More statistics will appear here once you have added some actions.</p>
|
||||
|
||||
<% end -%>
|
||||
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue