mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00

It's way more common to have presence enabled than disabled, so we should have been making it the default from start. This commit also changes the namespace of `<ChatUserAvatar />` into `<Chat::UserAvatar />` and refactors tests.
94 lines
2.8 KiB
Handlebars
94 lines
2.8 KiB
Handlebars
{{#if (and this.site.mobileView this.chat.activeMessage)}}
|
|
<div
|
|
class={{concat-class
|
|
"chat-message-actions-backdrop"
|
|
(if this.showFadeIn "fade-in")
|
|
}}
|
|
{{did-insert this.fadeAndVibrate}}
|
|
>
|
|
<div
|
|
role="button"
|
|
class="collapse-area"
|
|
{{on "touchstart" this.collapseMenu passive=false bubbles=false}}
|
|
>
|
|
</div>
|
|
|
|
<div class="chat-message-actions">
|
|
<div class="selected-message-container">
|
|
<div class="selected-message">
|
|
<Chat::UserAvatar @user={{this.message.user}} />
|
|
<span
|
|
{{on "touchstart" this.expandReply passive=true}}
|
|
role="button"
|
|
class={{concat-class
|
|
"selected-message-reply"
|
|
(if this.hasExpandedReply "is-expanded")
|
|
}}
|
|
>
|
|
{{this.message.message}}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="secondary-actions">
|
|
{{#each this.messageInteractor.secondaryActions as |button|}}
|
|
<li class="chat-message-action-item" data-id={{button.id}}>
|
|
<DButton
|
|
@class="chat-message-action"
|
|
@translatedLabel={{button.name}}
|
|
@icon={{button.icon}}
|
|
@actionParam={{button.id}}
|
|
@action={{action this.actAndCloseMenu button.id}}
|
|
/>
|
|
</li>
|
|
{{/each}}
|
|
</ul>
|
|
|
|
{{#if
|
|
(or this.messageInteractor.canReact this.messageInteractor.canReply)
|
|
}}
|
|
<div class="main-actions">
|
|
{{#if this.messageInteractor.canReact}}
|
|
{{#each this.messageInteractor.emojiReactions as |reaction|}}
|
|
<ChatMessageReaction
|
|
@reaction={{reaction}}
|
|
@onReaction={{this.messageInteractor.react}}
|
|
@message={{this.message}}
|
|
@showCount={{false}}
|
|
/>
|
|
{{/each}}
|
|
|
|
<DButton
|
|
@class="btn-flat react-btn"
|
|
@action={{this.openEmojiPicker}}
|
|
@icon="discourse-emojis"
|
|
@title="chat.react"
|
|
@forwardEvent={{true}}
|
|
data-id="react"
|
|
/>
|
|
{{/if}}
|
|
|
|
{{#if this.messageInteractor.canBookmark}}
|
|
<DButton
|
|
@class="btn-flat bookmark-btn"
|
|
@action={{action this.actAndCloseMenu "toggleBookmark"}}
|
|
data-id="bookmark"
|
|
>
|
|
<BookmarkIcon @bookmark={{this.message.bookmark}} />
|
|
</DButton>
|
|
{{/if}}
|
|
|
|
{{#if this.messageInteractor.canReply}}
|
|
<DButton
|
|
@class="chat-message-action reply-btn btn-flat"
|
|
@action={{action this.actAndCloseMenu "reply"}}
|
|
@icon="reply"
|
|
@title="chat.reply"
|
|
data-id="reply"
|
|
/>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
{{/if}} |