56 lines
1.7 KiB
Twig
56 lines
1.7 KiB
Twig
{% extends 'layout.twig' %}
|
||
{% block title %}Диалоги{% endblock %}
|
||
{% block main %}
|
||
{% if isAuthorized %}
|
||
<h1>Диалог # {{ dialog_id }} с "{{ companionName }} ({{ companionId }})"</h1>
|
||
|
||
<!--
|
||
<table class="table">
|
||
<thead>
|
||
<tr>
|
||
<td>ID</td>
|
||
<td>От</td>
|
||
<td>Кому</td>
|
||
<td>Дата</td>
|
||
<td>Сообщение</td>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for message in messages %}
|
||
<tr>
|
||
<td>{{ message.id }}</td>
|
||
<td>{{ message.user_from_data.name }} ({{ message.user_from_data.login }})</td>
|
||
<td>{{ message.user_to_data.name }} ({{ message.user_to_data.login }})</td>
|
||
<td>{{ message.date }}</td>
|
||
<td>{{ message.text }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
-->
|
||
|
||
|
||
|
||
|
||
<div class="messageBox">
|
||
{% for message in messages %}
|
||
<div class="message {% if message.user_from == userId %}fromMe{% else %}fromCompanion{% endif %}">{{ message.text }}</div>
|
||
{% endfor %}
|
||
</div>
|
||
|
||
|
||
|
||
|
||
|
||
<p>
|
||
<form method="POST" action="/users/{{ companionId }}/sendMessage">
|
||
<input type="hidden" name="dialogId" value="{{ dialog_id }}">
|
||
<textarea name="message"></textarea>
|
||
<button class="button w100" type="submit">Отправить</button>
|
||
</form>
|
||
</p>
|
||
|
||
{% else %}
|
||
<div class="alert alert-error">Вы не авторизованы</div>
|
||
{% endif %}
|
||
{% endblock %} |