UX: show real name on the about page
This commit is contained in:
parent
ddb8378ab0
commit
b04fae2e2c
|
@ -1,9 +1,7 @@
|
||||||
import ObjectController from 'discourse/controllers/object';
|
import ObjectController from 'discourse/controllers/object';
|
||||||
|
|
||||||
export default ObjectController.extend({
|
export default ObjectController.extend({
|
||||||
faqOverriden: function() {
|
faqOverriden: Ember.computed.gt('siteSettings.faq_url.length', 0),
|
||||||
return !(this.siteSettings.faq_url.length === 0);
|
|
||||||
}.property(),
|
|
||||||
|
|
||||||
contactInfo: function() {
|
contactInfo: function() {
|
||||||
if (Discourse.SiteSettings.contact_email) {
|
if (Discourse.SiteSettings.contact_email) {
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
{{#link-to 'user' user.username}}
|
{{#link-to 'user' user.username}}
|
||||||
{{avatar user imageSize="tiny"}}
|
{{avatar user imageSize="tiny"}}
|
||||||
{{user.username}}
|
{{user.username}}
|
||||||
|
{{#if user.name}}
|
||||||
|
({{user.name}})
|
||||||
|
{{/if}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
class AboutSerializer < ApplicationSerializer
|
class AboutSerializer < ApplicationSerializer
|
||||||
has_many :moderators, serializer: BasicUserSerializer, embed: :objects
|
has_many :moderators, serializer: UserNameSerializer, embed: :objects
|
||||||
has_many :admins, serializer: BasicUserSerializer, embed: :objects
|
has_many :admins, serializer: UserNameSerializer, embed: :objects
|
||||||
|
|
||||||
attributes :stats,
|
attributes :stats,
|
||||||
:description,
|
:description,
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue