diff --git a/app/assets/javascripts/discourse/templates/about.hbs b/app/assets/javascripts/discourse/templates/about.hbs index 96e592c14..2fe8cfdcb 100644 --- a/app/assets/javascripts/discourse/templates/about.hbs +++ b/app/assets/javascripts/discourse/templates/about.hbs @@ -37,31 +37,37 @@ <th> </th> <th>{{i18n 'about.stat.all_time'}}</th> <th>{{i18n 'about.stat.last_7_days'}}</th> + <th>{{i18n 'about.stat.last_30_days'}}</th> </tr> <tr> <td class='title'>{{i18n 'about.topic_count'}}</td> <td>{{number stats.topic_count}}</td> <td>{{number stats.topics_7_days}}</td> + <td>{{number stats.topics_30_days}}</td> </tr> <tr> <td>{{i18n 'about.post_count'}}</td> <td>{{number stats.post_count}}</td> <td>{{number stats.posts_7_days}}</td> + <td>{{number stats.posts_30_days}}</td> </tr> <tr> <td>{{i18n 'about.user_count'}}</td> <td>{{number stats.user_count}}</td> <td>{{number stats.users_7_days}}</td> + <td>{{number stats.users_30_days}}</td> </tr> <tr> <td>{{i18n 'about.active_user_count'}}</td> <td></td> <td>{{number stats.active_users_7_days}}</td> + <td>{{number stats.active_users_30_days}}</td> </tr> <tr> <td>{{i18n 'about.like_count'}}</td> <td>{{number stats.like_count}}</td> <td>{{number stats.likes_7_days}}</td> + <td>{{number stats.likes_30_days}}</td> </tr> </table> </section> diff --git a/app/models/about.rb b/app/models/about.rb index aa76b2243..ad77c5915 100644 --- a/app/models/about.rb +++ b/app/models/about.rb @@ -40,13 +40,16 @@ class About post_count: Post.count, user_count: User.count, topics_7_days: Topic.listable_topics.where('created_at > ?', 7.days.ago).count, + topics_30_days: Topic.listable_topics.where('created_at > ?', 30.days.ago).count, posts_7_days: Post.where('created_at > ?', 7.days.ago).count, + posts_30_days: Post.where('created_at > ?', 30.days.ago).count, users_7_days: User.where('created_at > ?', 7.days.ago).count, + users_30_days: User.where('created_at > ?', 30.days.ago).count, active_users_7_days: User.where('last_seen_at > ?', 7.days.ago).count, + active_users_30_days: User.where('last_seen_at > ?', 30.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) - .count + likes_7_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 7.days.ago).count, + likes_30_days: UserAction.where(action_type: UserAction::LIKE).where("created_at > ?", 30.days.ago).count } end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 02d1f7f00..ceca7799e 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -156,6 +156,7 @@ en: stat: all_time: "All Time" last_7_days: "Last 7 Days" + last_30_days: "Last 30 Days" like_count: "Likes" topic_count: "Topics" post_count: "Posts"