UX: show real name on the about page

This commit is contained in:
Arpit Jalan 2015-02-23 20:26:30 +05:30
parent ddb8378ab0
commit b04fae2e2c
4 changed files with 26 additions and 5 deletions

View File

@ -1,9 +1,7 @@
import ObjectController from 'discourse/controllers/object';
export default ObjectController.extend({
faqOverriden: function() {
return !(this.siteSettings.faq_url.length === 0);
}.property(),
faqOverriden: Ember.computed.gt('siteSettings.faq_url.length', 0),
contactInfo: function() {
if (Discourse.SiteSettings.contact_email) {

View File

@ -1,4 +1,7 @@
{{#link-to 'user' user.username}}
{{avatar user imageSize="tiny"}}
{{user.username}}
{{#if user.name}}
({{user.name}})
{{/if}}
{{/link-to}}

View File

@ -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,

View File

@ -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