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-row.hbs
Joffrey JAFFEUX b89df3ca9d
DEV: refactors routes to simplify using outlet (#20179)
This work will allow us to have an {{outlet}} chat.channel route and use it for threads as a sidepanel.
2023-02-07 13:59:32 +01:00

35 lines
1.1 KiB
Handlebars

<LinkTo
@route="chat.channel"
@models={{@channel.routeModels}}
class={{concat-class
"chat-channel-row"
(if @channel.focused "focused")
(if @channel.currentUserMembership.muted "muted")
(if @options.leaveButton "can-leave")
(if (eq this.chat.activeChannel.id @channel.id) "active")
(if this.channelHasUnread "has-unread")
}}
tabindex="0"
data-chat-channel-id={{@channel.id}}
{{did-insert this.startTrackingStatus}}
{{will-destroy this.stopTrackingStatus}}
>
<ChatChannelTitle @channel={{@channel}} />
<ChatChannelMetadata @channel={{@channel}} @unreadIndicator={{true}} />
{{#if (and @options.leaveButton @channel.isFollowing this.site.desktopView)}}
<ToggleChannelMembershipButton
@channel={{@channel}}
@options={{hash
leaveClass="btn-flat chat-channel-leave-btn"
labelType="none"
leaveIcon="times"
leaveTitle=(if
@channel.isDirectMessageChannel
(i18n "chat.direct_messages.leave")
(i18n "chat.channel_settings.leave_channel")
)
}}
/>
{{/if}}
</LinkTo>