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-thread.hbs
2023-03-03 11:54:13 +10:00

62 lines
1.8 KiB
Handlebars

<div
class={{concat-class "chat-thread" (if this.loading "loading")}}
data-id={{this.thread.id}}
{{did-insert this.loadMessages}}
>
<div class="chat-thread__header">
<div class="chat-thread__info">
<div class="chat-thread__title">
<h2>{{this.title}}</h2>
<LinkTo
class="chat-thread__close"
@route="chat.channel"
@models={{this.chat.activeChannel.routeModels}}
>
{{d-icon "times"}}
</LinkTo>
</div>
<p class="chat-thread__om">
{{replace-emoji this.thread.originalMessage.excerpt}}
</p>
<div class="chat-thread__omu">
<span class="chat-thread__started-by">{{i18n
"chat.threads.started_by"
}}</span>
<ChatMessageAvatar
class="chat-thread__omu-avatar"
@message={{this.thread.originalMessage}}
/>
<span
class="chat-thread__omu-username"
>{{this.thread.originalMessageUser.username}}</span>
</div>
</div>
</div>
<div class="chat-thread__messages">
<ul>
{{#each this.thread.messages as |message|}}
<li>{{message.user.username}} sez: {{message.message}}</li>
{{/each}}
</ul>
{{#if (or this.loading this.loadingMoreFuture)}}
<ChatSkeleton />
{{/if}}
</div>
<ChatComposer
@canInteractWithChat="true"
@sendMessage={{this.sendMessage}}
@editMessage={{this.editMessage}}
@setReplyTo={{this.setReplyTo}}
@loading={{this.sendingLoading}}
@editingMessage={{readonly this.editingMessage}}
@onCancelEditing={{this.cancelEditing}}
@setInReplyToMsg={{this.setInReplyToMsg}}
@onEditLastMessageRequested={{this.editLastMessageRequested}}
@onValueChange={{this.composerValueChanged}}
@chatChannel={{this.channel}}
/>
</div>