Files
delta_framework/templates/dialog.twig
T

60 lines
1.9 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' %}
{% 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 %}">
<div class="name">{{ message.user_from_data.name }}</div>
<div class="text">{{ message.text }}</div>
<div class="date">{{ message.date }}</div>
</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 %}