diff --git a/app/assets/javascripts/discourse/controllers/about.js.es6 b/app/assets/javascripts/discourse/controllers/about.js.es6 index f88b331ca..2eeadfc68 100644 --- a/app/assets/javascripts/discourse/controllers/about.js.es6 +++ b/app/assets/javascripts/discourse/controllers/about.js.es6 @@ -1,6 +1,8 @@ import ObjectController from 'discourse/controllers/object'; export default ObjectController.extend({ + faqOverriden: Ember.computed.gt('siteSettings.faq_url.length', 0), + contactInfo: function() { if (Discourse.SiteSettings.contact_email) { return I18n.t('about.contact_info', {contact_email: Discourse.SiteSettings.contact_email}); diff --git a/app/assets/javascripts/discourse/templates/about.hbs b/app/assets/javascripts/discourse/templates/about.hbs index 077f8fb72..ecfa576de 100644 --- a/app/assets/javascripts/discourse/templates/about.hbs +++ b/app/assets/javascripts/discourse/templates/about.hbs @@ -1,82 +1,97 @@ -
-
-

{{i18n 'about.title' title=title}}

-

{{description}}

-
+
+
- {{#if admins}} -
-

{{i18n 'about.our_admins'}}

- - {{#each a in admins}} - {{user-small user=a}} - {{/each}} -
+ +
+

{{i18n 'about.title' title=title}}

+

{{description}}

- {{/if}} - {{#if moderators}} -
-

{{i18n 'about.our_moderators'}}

+ {{#if admins}} +
+

{{i18n 'about.our_admins'}}

-
- {{#each m in moderators}} - {{user-small user=m}} + {{#each a in admins}} + {{user-small user=a}} {{/each}} -
-
+
+ +
+ {{/if}} + + {{#if moderators}} +
+

{{i18n 'about.our_moderators'}}

+ +
+ {{#each m in moderators}} + {{user-small user=m}} + {{/each}} +
+
+
+ {{/if}} + +
+

{{i18n 'about.stats'}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 {{i18n 'about.stat.all_time'}}{{i18n 'about.stat.last_7_days'}}{{i18n 'about.stat.last_30_days'}}
{{i18n 'about.topic_count'}}{{number stats.topic_count}}{{number stats.topics_7_days}}{{number stats.topics_30_days}}
{{i18n 'about.post_count'}}{{number stats.post_count}}{{number stats.posts_7_days}}{{number stats.posts_30_days}}
{{i18n 'about.user_count'}}{{number stats.user_count}}{{number stats.users_7_days}}{{number stats.users_30_days}}
{{i18n 'about.active_user_count'}}{{number stats.active_users_7_days}}{{number stats.active_users_30_days}}
{{i18n 'about.like_count'}}{{number stats.like_count}}{{number stats.likes_7_days}}{{number stats.likes_30_days}}
- {{/if}} -
-

{{i18n 'about.stats'}}

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 {{i18n 'about.stat.all_time'}}{{i18n 'about.stat.last_7_days'}}{{i18n 'about.stat.last_30_days'}}
{{i18n 'about.topic_count'}}{{number stats.topic_count}}{{number stats.topics_7_days}}{{number stats.topics_30_days}}
{{i18n 'about.post_count'}}{{number stats.post_count}}{{number stats.posts_7_days}}{{number stats.posts_30_days}}
{{i18n 'about.user_count'}}{{number stats.user_count}}{{number stats.users_7_days}}{{number stats.users_30_days}}
{{i18n 'about.active_user_count'}}{{number stats.active_users_7_days}}{{number stats.active_users_30_days}}
{{i18n 'about.like_count'}}{{number stats.like_count}}{{number stats.likes_7_days}}{{number stats.likes_30_days}}
-
- - {{#if contactInfo}} -
-

{{i18n 'about.contact'}}

-

{{contactInfo}}

-
- {{/if}} + {{#if contactInfo}} +
+

{{i18n 'about.contact'}}

+

{{contactInfo}}

+
+ {{/if}} +
diff --git a/app/assets/javascripts/discourse/templates/components/user-small.hbs b/app/assets/javascripts/discourse/templates/components/user-small.hbs index 674f8f759..2bf19059d 100644 --- a/app/assets/javascripts/discourse/templates/components/user-small.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-small.hbs @@ -1,4 +1,7 @@ {{#link-to 'user' user.username}} {{avatar user imageSize="tiny"}} {{user.username}} + {{#if user.name}} + ({{user.name}}) + {{/if}} {{/link-to}} diff --git a/app/serializers/about_serializer.rb b/app/serializers/about_serializer.rb index 63d795499..df8eebc17 100644 --- a/app/serializers/about_serializer.rb +++ b/app/serializers/about_serializer.rb @@ -1,6 +1,6 @@ class AboutSerializer < ApplicationSerializer - has_many :moderators, serializer: BasicUserSerializer, embed: :objects - has_many :admins, serializer: BasicUserSerializer, embed: :objects + has_many :moderators, serializer: UserNameSerializer, embed: :objects + has_many :admins, serializer: UserNameSerializer, embed: :objects attributes :stats, :description, diff --git a/app/serializers/user_name_serializer.rb b/app/serializers/user_name_serializer.rb new file mode 100644 index 000000000..b1fa1c2e1 --- /dev/null +++ b/app/serializers/user_name_serializer.rb @@ -0,0 +1,20 @@ +class UserNameSerializer < ApplicationSerializer + attributes :id, :username, :name, :uploaded_avatar_id, :avatar_template + + def include_name? + SiteSetting.enable_names? + end + + def avatar_template + if Hash === object + User.avatar_template(user[:username], user[:uploaded_avatar_id]) + else + object.avatar_template + end + end + + def user + object[:user] || object + end + +end diff --git a/app/views/static/show.html.erb b/app/views/static/show.html.erb index 305b137c9..e6aa2892e 100644 --- a/app/views/static/show.html.erb +++ b/app/views/static/show.html.erb @@ -1,4 +1,5 @@