FEATURE: show number of active users in the last 7 days on about page

This commit is contained in:
Neil Lalonde 2015-01-30 17:23:52 -05:00
parent 79a7c7ce41
commit 750b27f973
3 changed files with 8 additions and 1 deletions

View file

@ -53,6 +53,11 @@
<td>{{number stats.user_count}}</td>
<td>{{number stats.users_7_days}}</td>
</tr>
<tr>
<td>{{i18n 'about.active_user_count'}}</td>
<td></td>
<td>{{number stats.active_users_7_days}}</td>
</tr>
<tr>
<td>{{i18n 'about.like_count'}}</td>
<td>{{number stats.like_count}}</td>

View file

@ -42,6 +42,7 @@ class About
topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count,
posts_7_days: Post.where('created_at > ?', 7.days.ago).count,
users_7_days: User.where('created_at > ?', 7.days.ago).count,
active_users_7_days: User.where('last_seen_at > ?', 7.days.ago).count,
like_count: UserAction.where(action_type: UserAction::LIKE).count,
likes_7_days: UserAction.where(action_type: UserAction::LIKE)
.where("created_at > ?", 7.days.ago)

View file

@ -159,7 +159,8 @@ en:
like_count: "Likes"
topic_count: "Topics"
post_count: "Posts"
user_count: "Users"
user_count: "New Users"
active_user_count: "Active Users"
contact: "Contact Us"
contact_info: "In the event of a critical issue or urgent matter affecting this site, please contact us at %{contact_email}."