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-message-info.hbs
Martin Brennan 7e34b840ca FEATURE: Skeleton for loading threads in a side pane
This commit includes:

* Additions to message and channel serializers for threads
* New route and controller for a single thread
* JS route for thread pane
* Extremely basic thread pane component
* Additions to channel manager to deal with threads, and ChatThread JS model
* Changes to chat publisher and existing JS to get new thread ID when
  message is created
2023-02-03 17:32:08 +10:00

56 lines
1.6 KiB
Handlebars

<div class="chat-message-info">
{{#if @message.chat_webhook_event}}
{{#if @message.chat_webhook_event.username}}
<span class="chat-message-info__username {{this.usernameClasses}}">
{{@message.chat_webhook_event.username}}
</span>
{{/if}}
<span class="chat-message-info__bot-indicator">
{{i18n "chat.bot"}}
</span>
{{else}}
<span
role="button"
class="chat-message-info__username {{this.usernameClasses}} clickable"
data-user-card={{@message.user.username}}
>
<span class="chat-message-info__username__name">{{this.name}}</span>
{{#if this.showStatus}}
<div class="chat-message-info__status">
<UserStatusMessage @status={{@message.user.status}} />
</div>
{{/if}}
</span>
{{/if}}
<span class="chat-message-info__date">
{{format-chat-date @message @details}}
</span>
{{!-- TODO (martin): Remove this before merge. --}}
{{#if @message.thread_id}}
<span class="chat-message-info__thread_id">
THREAD ID: {{@message.thread_id}}
</span>
{{/if}}
{{#if @message.bookmark}}
<span class="chat-message-info__bookmark">
<BookmarkIcon @bookmark={{@message.bookmark}} />
</span>
{{/if}}
{{#if this.isFlagged}}
<span class="chat-message-info__flag">
{{#if @message.reviewable_id}}
<LinkTo @route="review.show" @model={{@message.reviewable_id}}>
{{d-icon "flag" title="chat.flagged"}}
</LinkTo>
{{else}}
{{d-icon "flag" title="chat.you_flagged"}}
{{/if}}
</span>
{{/if}}
</div>