mirror of
https://github.com/discourse/discourse.git
synced 2025-02-05 19:11:13 +00:00
DEV: Add helpers to customize poster title (#29156)
* DEV: Add helpers to customize poster title * fix formatting issues * Update app/assets/javascripts/discourse/app/templates/badges/show.hbs Co-authored-by: Jarek Radosz <jradosz@gmail.com> --------- Co-authored-by: Jarek Radosz <jradosz@gmail.com>
This commit is contained in:
parent
3c03d9b1e5
commit
5b69329656
@ -37,10 +37,18 @@
|
||||
|
||||
{{#if this.canSelectTitle}}
|
||||
<div class="badge-set-title {{if this.hiddenSetTitle 'hidden' ''}}">
|
||||
<PluginOutlet
|
||||
@name="selectable-user-badges"
|
||||
@outletArgs={{hash
|
||||
selectableUserBadges=this.selectableUserBadges
|
||||
closeAction=this.toggleSetUserTitle
|
||||
}}
|
||||
>
|
||||
<BadgeTitle
|
||||
@selectableUserBadges={{this.selectableUserBadges}}
|
||||
@closeAction={{this.toggleSetUserTitle}}
|
||||
/>
|
||||
</PluginOutlet>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -167,8 +167,20 @@ export default createWidget("poster-name", {
|
||||
);
|
||||
}
|
||||
|
||||
this.buildTitleObject(attrs, contents);
|
||||
|
||||
if (this.siteSettings.enable_user_status) {
|
||||
this.addUserStatus(contents, attrs);
|
||||
}
|
||||
|
||||
return contents;
|
||||
},
|
||||
|
||||
buildTitleObject(attrs, contents) {
|
||||
const primaryGroupName = attrs.primary_group_name;
|
||||
const title = attrs.user_title,
|
||||
titleIsGroup = attrs.title_is_group;
|
||||
|
||||
if (title && title.length) {
|
||||
contents.push(
|
||||
this.attach("poster-name-title", {
|
||||
@ -178,12 +190,6 @@ export default createWidget("poster-name", {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (this.siteSettings.enable_user_status) {
|
||||
this.addUserStatus(contents, attrs);
|
||||
}
|
||||
|
||||
return contents;
|
||||
},
|
||||
|
||||
addUserStatus(contents, attrs) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user