mirror of
https://github.com/discourse/discourse.git
synced 2025-06-20 23:41:31 +08: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:

committed by
GitHub

parent
3c03d9b1e5
commit
5b69329656
@ -37,10 +37,18 @@
|
|||||||
|
|
||||||
{{#if this.canSelectTitle}}
|
{{#if this.canSelectTitle}}
|
||||||
<div class="badge-set-title {{if this.hiddenSetTitle 'hidden' ''}}">
|
<div class="badge-set-title {{if this.hiddenSetTitle 'hidden' ''}}">
|
||||||
<BadgeTitle
|
<PluginOutlet
|
||||||
@selectableUserBadges={{this.selectableUserBadges}}
|
@name="selectable-user-badges"
|
||||||
@closeAction={{this.toggleSetUserTitle}}
|
@outletArgs={{hash
|
||||||
/>
|
selectableUserBadges=this.selectableUserBadges
|
||||||
|
closeAction=this.toggleSetUserTitle
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<BadgeTitle
|
||||||
|
@selectableUserBadges={{this.selectableUserBadges}}
|
||||||
|
@closeAction={{this.toggleSetUserTitle}}
|
||||||
|
/>
|
||||||
|
</PluginOutlet>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</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,
|
const title = attrs.user_title,
|
||||||
titleIsGroup = attrs.title_is_group;
|
titleIsGroup = attrs.title_is_group;
|
||||||
|
|
||||||
if (title && title.length) {
|
if (title && title.length) {
|
||||||
contents.push(
|
contents.push(
|
||||||
this.attach("poster-name-title", {
|
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) {
|
addUserStatus(contents, attrs) {
|
||||||
|
Reference in New Issue
Block a user