diff --git a/app/assets/javascripts/discourse/templates/about.js.handlebars b/app/assets/javascripts/discourse/templates/about.js.handlebars index 2b6149b2a1c..7e0fa71b64b 100644 --- a/app/assets/javascripts/discourse/templates/about.js.handlebars +++ b/app/assets/javascripts/discourse/templates/about.js.handlebars @@ -1,5 +1,8 @@
-

{{i18n about.title}}

+
+

{{i18n about.title title=title}}

+

{{description}}

+
{{#if admins}}
@@ -36,22 +39,26 @@ {{i18n about.stat.last_7_days}} {{i18n about.topic_count}} - {{stats.topic_count}} - {{stats.topics_7_days}} + {{number stats.topic_count}} + {{number stats.topics_7_days}} {{i18n about.post_count}} - {{stats.post_count}} - {{stats.posts_7_days}} + {{number stats.post_count}} + {{number stats.posts_7_days}} {{i18n about.user_count}} - {{stats.user_count}} - {{stats.users_7_days}} + {{number stats.user_count}} + {{number stats.users_7_days}} + + {{i18n about.like_count}} + {{number stats.like_count}} + {{number stats.likes_7_days}} + +
- -
diff --git a/app/assets/javascripts/discourse/templates/site_map.js.handlebars b/app/assets/javascripts/discourse/templates/site_map.js.handlebars index 94490e6026d..d0f7f69071c 100644 --- a/app/assets/javascripts/discourse/templates/site_map.js.handlebars +++ b/app/assets/javascripts/discourse/templates/site_map.js.handlebars @@ -27,6 +27,9 @@
  • {{i18n faq}}
  • +
  • + {{#link-to 'about'}}{{i18n about.simple_title}}{{/link-to}} +
  • {{#if showMobileToggle}}
  • {{boundI18n mobileViewLinkTextKey}}
  • {{/if}} diff --git a/app/assets/stylesheets/common/base/about.scss b/app/assets/stylesheets/common/base/about.scss index e3ef8ecc398..85c283ea36c 100644 --- a/app/assets/stylesheets/common/base/about.scss +++ b/app/assets/stylesheets/common/base/about.scss @@ -17,6 +17,10 @@ section.about { padding-bottom: 10px; + p { + margin: 10px 0; + } + table { margin-top: 20px; width: 100%; diff --git a/app/models/about.rb b/app/models/about.rb index 4bc4b187835..73978b7bb0b 100644 --- a/app/models/about.rb +++ b/app/models/about.rb @@ -4,12 +4,30 @@ class About attr_accessor :moderators, :admins + def version + Discourse::VERSION::STRING + end + + def title + SiteSetting.title + end + + def locale + SiteSetting.default_locale + end + + def description + SiteSetting.site_description + end + def moderators @moderators ||= User.where(moderator: true) + .where.not(id: Discourse::SYSTEM_USER_ID) end def admins @admins ||= User.where(admin: true) + .where.not(id: Discourse::SYSTEM_USER_ID) end def stats @@ -19,7 +37,11 @@ class About user_count: User.count, 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 + users_7_days: User.where('created_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) + .count } end diff --git a/app/serializers/about_serializer.rb b/app/serializers/about_serializer.rb index 67a04e9879d..b56a1658807 100644 --- a/app/serializers/about_serializer.rb +++ b/app/serializers/about_serializer.rb @@ -2,5 +2,9 @@ class AboutSerializer < ApplicationSerializer has_many :moderators, serializer: BasicUserSerializer, embed: :objects has_many :admins, serializer: BasicUserSerializer, embed: :objects - attributes :stats + attributes :stats, + :description, + :title, + :locale, + :version end diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 65caea5f38e..58bb6bfb493 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -145,11 +145,13 @@ en: title: "Suggested Topics" about: - title: "About" + simple_title: "About" + title: "About %{title}" stats: "Site Statistics" stat: all_time: "All Time" last_7_days: "Last 7 Days" + like_count: "Like Count" topic_count: "Topic Count" post_count: "Post Count" user_count: "User Count"