Files
delta_framework/templates/dialog.twig
T

51 lines
2.7 KiB
Twig
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{% extends 'layout.twig' %}
{% import '_icons.twig' as icons %}
{% block title %}Диалог с {{ companionName }}{% endblock %}
{% block main %}
{% if isAuthorized %}
<a class="back-link" href="/dialogs">{{ icons.arrowLeft() }} Все диалоги</a>
<div class="chat-panel" id="chatPanel" data-dialog-id="{{ dialog_id }}" data-messages-count="{{ messagesCount }}">
<div class="chat-panel-header">
<span class="user-avatar chat-panel-avatar">
{% if companionAvatar %}
<img src="{{ companionAvatar }}" alt="{{ companionName }}">
{% else %}
{{ (companionName|default('?'))|slice(0, 1)|upper }}
{% endif %}
</span>
<div class="chat-panel-header-meta">
<strong>{{ companionName }}</strong>
<span class="status {% if companionOnline %}is-online{% endif %}" id="companionStatus">
<span class="status-dot"></span>
<span id="companionStatusText">{{ companionOnline ? 'Онлайн' : 'Не в сети' }}</span>
</span>
</div>
<span class="pill">{{ icons.chat() }} <span id="messagesCountText">{{ messagesCount }}</span> сообщений</span>
</div>
<div class="messageBox" id="messageBox">
{% include '_messageList.twig' with {messages: messages, userId: userId} %}
</div>
<div class="chat-compose">
<form method="POST" action="/users/{{ companionId }}/sendMessage" enctype="multipart/form-data" id="chatComposeForm">
<input type="hidden" name="dialogId" value="{{ dialog_id }}">
<textarea name="message" id="chatMessageInput" placeholder="Введите сообщение... (Enter — отправить, Shift+Enter — новая строка)"></textarea>
<div class="chat-compose-actions">
<label class="input-file">
<input type="file" name="file" id="chatFileInput">
<span id="chatFileLabel">{{ icons.paperclip() }} Файл</span>
</label>
<button class="button" type="submit" value="sendMessage" id="chatSendButton">{{ icons.send() }} Отправить</button>
</div>
</form>
</div>
</div>
<script src="/assets/js/chat.js?{{ salt }}"></script>
{% else %}
<div class="alert alert-error">{{ icons.warning() }}<span>Вы не авторизованы</span></div>
{% endif %}
{% endblock %}