mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 09:42:02 +08:00
DEV: Add outlet wrapper for user card information replacement (#29523)
Some checks are pending
Licenses / run (push) Waiting to run
Linting / run (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (annotations, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (backend, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (backend, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (frontend, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (frontend, themes) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, chat) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, themes) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Chrome) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Firefox ESR) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Firefox Evergreen) (push) Waiting to run
Some checks are pending
Licenses / run (push) Waiting to run
Linting / run (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (annotations, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (backend, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (backend, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (frontend, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (frontend, themes) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, chat) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, core) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, plugins) (push) Waiting to run
Tests / ${{ matrix.target }} ${{ matrix.build_type }} (system, themes) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Chrome) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Firefox ESR) (push) Waiting to run
Tests / core frontend (${{ matrix.browser }}) (Firefox Evergreen) (push) Waiting to run
* DEV: Add outlet wrapper for user card information replacement * Fix format issues * Fix format issues
This commit is contained in:
parent
afdca41fd5
commit
758de8167b
|
@ -27,56 +27,48 @@
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="card-row first-row">
|
<div class="card-row first-row">
|
||||||
<div class="user-card-avatar" aria-hidden="true">
|
<PluginOutlet
|
||||||
{{#if this.contentHidden}}
|
@name="user-card-main-info"
|
||||||
<span class="card-huge-avatar">{{bound-avatar
|
@outletArgs={{hash
|
||||||
this.user
|
user=this.user
|
||||||
"huge"
|
post=this.post
|
||||||
}}</span>
|
contentHidden=this.contentHidden
|
||||||
{{else}}
|
handleShowUser=this.handleShowUser
|
||||||
<a
|
}}
|
||||||
{{on "click" this.handleShowUser}}
|
>
|
||||||
href={{this.user.path}}
|
<div class="user-card-avatar" aria-hidden="true">
|
||||||
class="card-huge-avatar"
|
|
||||||
tabindex="-1"
|
|
||||||
>{{bound-avatar this.user "huge"}}</a>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<UserAvatarFlair @user={{this.user}} />
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<PluginOutlet
|
|
||||||
@name="user-card-avatar-flair"
|
|
||||||
@connectorTagName="div"
|
|
||||||
@outletArgs={{hash user=this.user}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="names">
|
|
||||||
<div
|
|
||||||
class="names__primary
|
|
||||||
{{this.staff}}
|
|
||||||
{{this.newUser}}
|
|
||||||
{{if this.nameFirst 'full-name' 'username'}}"
|
|
||||||
>
|
|
||||||
{{#if this.contentHidden}}
|
{{#if this.contentHidden}}
|
||||||
<span class="name-username-wrapper">
|
<span class="card-huge-avatar">{{bound-avatar
|
||||||
{{if
|
this.user
|
||||||
this.nameFirst
|
"huge"
|
||||||
this.user.name
|
}}</span>
|
||||||
(format-username this.user.username)
|
|
||||||
}}
|
|
||||||
</span>
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<a
|
<a
|
||||||
{{on "click" this.handleShowUser}}
|
{{on "click" this.handleShowUser}}
|
||||||
href={{this.user.path}}
|
href={{this.user.path}}
|
||||||
class="user-profile-link"
|
class="card-huge-avatar"
|
||||||
aria-label={{i18n
|
tabindex="-1"
|
||||||
"user.profile_link"
|
>{{bound-avatar this.user "huge"}}</a>
|
||||||
username=this.user.username
|
{{/if}}
|
||||||
}}
|
|
||||||
>
|
<UserAvatarFlair @user={{this.user}} />
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<PluginOutlet
|
||||||
|
@name="user-card-avatar-flair"
|
||||||
|
@connectorTagName="div"
|
||||||
|
@outletArgs={{hash user=this.user}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="names">
|
||||||
|
<div
|
||||||
|
class="names__primary
|
||||||
|
{{this.staff}}
|
||||||
|
{{this.newUser}}
|
||||||
|
{{if this.nameFirst 'full-name' 'username'}}"
|
||||||
|
>
|
||||||
|
{{#if this.contentHidden}}
|
||||||
<span class="name-username-wrapper">
|
<span class="name-username-wrapper">
|
||||||
{{if
|
{{if
|
||||||
this.nameFirst
|
this.nameFirst
|
||||||
|
@ -84,45 +76,65 @@
|
||||||
(format-username this.user.username)
|
(format-username this.user.username)
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
{{user-status this.user currentUser=this.currentUser}}
|
{{else}}
|
||||||
</a>
|
<a
|
||||||
{{/if}}
|
{{on "click" this.handleShowUser}}
|
||||||
</div>
|
href={{this.user.path}}
|
||||||
<PluginOutlet
|
class="user-profile-link"
|
||||||
@name="user-card-after-username"
|
aria-label={{i18n
|
||||||
@connectorTagName="div"
|
"user.profile_link"
|
||||||
@outletArgs={{hash user=this.user showUser=this.handleShowUser}}
|
username=this.user.username
|
||||||
/>
|
}}
|
||||||
{{#if this.nameFirst}}
|
>
|
||||||
<div class="names__secondary username">{{this.user.username}}</div>
|
<span class="name-username-wrapper">
|
||||||
{{else}}
|
{{if
|
||||||
{{#if this.user.name}}
|
this.nameFirst
|
||||||
<div class="names__secondary full-name">{{this.user.name}}</div>
|
this.user.name
|
||||||
{{/if}}
|
(format-username this.user.username)
|
||||||
{{/if}}
|
}}
|
||||||
{{#if this.user.title}}
|
</span>
|
||||||
<div class="names__secondary">{{this.user.title}}</div>
|
{{user-status this.user currentUser=this.currentUser}}
|
||||||
{{/if}}
|
</a>
|
||||||
{{#if this.user.staged}}
|
{{/if}}
|
||||||
<div class="names__secondary staged">{{i18n "user.staged"}}</div>
|
|
||||||
{{/if}}
|
|
||||||
{{#if this.hasStatus}}
|
|
||||||
<div class="user-status">
|
|
||||||
{{html-safe this.userStatusEmoji}}
|
|
||||||
<span class="user-status__description">
|
|
||||||
{{this.user.status.description}}
|
|
||||||
</span>
|
|
||||||
{{format-date this.user.status.ends_at format="tiny"}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
|
||||||
<div>
|
|
||||||
<PluginOutlet
|
<PluginOutlet
|
||||||
@name="user-card-post-names"
|
@name="user-card-after-username"
|
||||||
@connectorTagName="div"
|
@connectorTagName="div"
|
||||||
@outletArgs={{hash user=this.user}}
|
@outletArgs={{hash user=this.user showUser=this.handleShowUser}}
|
||||||
/>
|
/>
|
||||||
|
{{#if this.nameFirst}}
|
||||||
|
<div
|
||||||
|
class="names__secondary username"
|
||||||
|
>{{this.user.username}}</div>
|
||||||
|
{{else}}
|
||||||
|
{{#if this.user.name}}
|
||||||
|
<div class="names__secondary full-name">{{this.user.name}}</div>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
{{#if this.user.title}}
|
||||||
|
<div class="names__secondary">{{this.user.title}}</div>
|
||||||
|
{{/if}}
|
||||||
|
{{#if this.user.staged}}
|
||||||
|
<div class="names__secondary staged">{{i18n "user.staged"}}</div>
|
||||||
|
{{/if}}
|
||||||
|
{{#if this.hasStatus}}
|
||||||
|
<div class="user-status">
|
||||||
|
{{html-safe this.userStatusEmoji}}
|
||||||
|
<span class="user-status__description">
|
||||||
|
{{this.user.status.description}}
|
||||||
|
</span>
|
||||||
|
{{format-date this.user.status.ends_at format="tiny"}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
<div>
|
||||||
|
<PluginOutlet
|
||||||
|
@name="user-card-post-names"
|
||||||
|
@connectorTagName="div"
|
||||||
|
@outletArgs={{hash user=this.user}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</PluginOutlet>
|
||||||
<ul class="usercard-controls">
|
<ul class="usercard-controls">
|
||||||
{{#if this.user.can_send_private_message_to_user}}
|
{{#if this.user.can_send_private_message_to_user}}
|
||||||
<li class="compose-pm">
|
<li class="compose-pm">
|
||||||
|
@ -378,20 +390,25 @@
|
||||||
|
|
||||||
{{#if this.showBadges}}
|
{{#if this.showBadges}}
|
||||||
<div class="card-row">
|
<div class="card-row">
|
||||||
{{#if this.user.featured_user_badges}}
|
<PluginOutlet
|
||||||
<div class="badge-section">
|
@name="user-card-badges"
|
||||||
{{#each this.user.featured_user_badges as |ub|}}
|
@outletArgs={{hash user=this.user post=this.post}}
|
||||||
<UserBadge @badge={{ub.badge}} @user={{this.user}} />
|
>
|
||||||
{{/each}}
|
{{#if this.user.featured_user_badges}}
|
||||||
{{#if this.showMoreBadges}}
|
<div class="badge-section">
|
||||||
<span class="more-user-badges">
|
{{#each this.user.featured_user_badges as |ub|}}
|
||||||
<LinkTo @route="user.badges" @model={{this.user}}>
|
<UserBadge @badge={{ub.badge}} @user={{this.user}} />
|
||||||
{{i18n "badges.more_badges" count=this.moreBadgesCount}}
|
{{/each}}
|
||||||
</LinkTo>
|
{{#if this.showMoreBadges}}
|
||||||
</span>
|
<span class="more-user-badges">
|
||||||
{{/if}}
|
<LinkTo @route="user.badges" @model={{this.user}}>
|
||||||
</div>
|
{{i18n "badges.more_badges" count=this.moreBadgesCount}}
|
||||||
{{/if}}
|
</LinkTo>
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</PluginOutlet>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user