This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/plugins/chat/assets/javascripts/discourse/components/chat-channel-title.hbs
David Taylor 9e440dca33 DEV: Rename all uses of PluginOutlet @args in core
The `args` argument is now deprecated. This commit uses a codemod (https://github.com/discourse/discourse-ember-codemods/tree/main/transforms/rename-plugin-outlet-args) to automatically rename all uses to `@outletArgs`.
2023-01-31 13:51:25 +00:00

70 lines
2.2 KiB
Handlebars

{{#if this.channel.isDraft}}
<div class="chat-channel-title is-draft">
<span class="chat-channel-title__name">{{this.channel.title}}</span>
{{#if (has-block)}}
{{yield}}
{{/if}}
</div>
{{else}}
{{#if this.channel.isDirectMessageChannel}}
<div class="chat-channel-title is-dm">
<div class="chat-channel-title__avatar">
{{#if this.multiDm}}
<span class="chat-channel-title__users-count">
{{this.channel.chatable.users.length}}
</span>
{{else}}
<ChatUserAvatar @user={{this.channel.chatable.users.firstObject}} />
{{/if}}
</div>
<div class="chat-channel-title__user-info">
<div class="chat-channel-title__usernames">
{{#if this.multiDm}}
<span class="chat-channel-title__name">{{this.usernames}}</span>
{{else}}
{{#let this.channel.chatable.users.firstObject as |user|}}
<span class="chat-channel-title__name">{{user.username}}</span>
{{#if this.showUserStatus}}
<UserStatusMessage
@status={{this.channel.chatable.users.firstObject.status}}
@showDescription={{if this.site.mobileView "true"}}
/>
{{/if}}
<PluginOutlet
@name="after-chat-channel-username"
@outletArgs={{hash user=user}}
@tagName=""
@connectorTagName=""
/>
{{/let}}
{{/if}}
</div>
</div>
{{#if (has-block)}}
{{yield}}
{{/if}}
</div>
{{else if this.channel.isCategoryChannel}}
<div class="chat-channel-title is-category">
<span
class="chat-channel-title__category-badge"
style={{this.channelColorStyle}}
>
{{d-icon "hashtag"}}
{{#if this.channel.chatable.read_restricted}}
{{d-icon "lock" class="chat-channel-title__restricted-category-icon"}}
{{/if}}
</span>
<span class="chat-channel-title__name">
{{replace-emoji this.channel.escapedTitle}}
</span>
{{#if (has-block)}}
{{yield}}
{{/if}}
</div>
{{/if}}
{{/if}}