Group posts adhere to prioritize name in UX option (#12789)
Displays either username or name on the group activity page. Removes hardcoded comma, and adds classes to share padding styling
This commit is contained in:
parent
a172a6cd9c
commit
27771ad189
|
@ -1,6 +1,7 @@
|
|||
import Component from "@ember/component";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { prioritizeNameInUx } from "discourse/lib/settings";
|
||||
import { propertyEqual } from "discourse/lib/computed";
|
||||
|
||||
export default Component.extend({
|
||||
|
@ -14,4 +15,12 @@ export default Component.extend({
|
|||
"post.post_type",
|
||||
"site.post_types.moderator_action"
|
||||
),
|
||||
|
||||
@discourseComputed("post.user")
|
||||
name() {
|
||||
if (prioritizeNameInUx(this.post.user.name)) {
|
||||
return this.post.user.name;
|
||||
}
|
||||
return this.post.user.username;
|
||||
},
|
||||
});
|
||||
|
|
|
@ -12,10 +12,10 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="group-post-category">{{category-link post.category}}</div>
|
||||
{{#if post.user.name}}
|
||||
<div class="group-member-info">
|
||||
<span class="name">{{post.user.name}}</span>
|
||||
{{#if post.user.title}}<span class="title">, {{post.user.title}}</span>{{/if}}
|
||||
{{#if post.user}}
|
||||
<div class="group-member-info names">
|
||||
<span class="name">{{name}}</span>
|
||||
{{#if post.user.title}}<span class="user-title">{{post.user.title}}</span>{{/if}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue