2022-04-09 19:08:53 +02:00
|
|
|
{% extends "layouts/app.twig" %}
|
|
|
|
{% import 'macros/base.twig' as m %}
|
|
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
|
2022-06-04 17:55:26 +02:00
|
|
|
{% block title %}{{ __('message.title') }}{% endblock %}
|
2022-04-09 19:08:53 +02:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container">
|
|
|
|
<div class="page-header">
|
|
|
|
<h1>
|
|
|
|
{{ block('title') }}
|
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
<form action="" enctype="multipart/form-data" method="post">
|
|
|
|
{{ csrf() }}
|
|
|
|
<div class="row gx-2 mb-3">
|
|
|
|
<div class="col-auto">
|
2023-04-19 22:34:08 +02:00
|
|
|
{{ f.select('user_id', null, users, {
|
|
|
|
'class': 'pe-5',
|
|
|
|
'required': true,
|
|
|
|
'default_option': __('message.choose_angel'),
|
|
|
|
}) }}
|
2022-04-09 19:08:53 +02:00
|
|
|
</div>
|
2023-05-11 16:57:45 +02:00
|
|
|
<div class="col-auto">
|
2022-06-04 17:55:26 +02:00
|
|
|
{{ f.submit(__('message.to_conversation'), {'btn_type': 'secondary'}) }}
|
2022-04-09 19:08:53 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<table class="table table-striped data">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2023-11-23 17:37:06 +01:00
|
|
|
<th>{{ __('general.angel') }}</th>
|
2022-06-04 17:55:26 +02:00
|
|
|
<th>{{ __('message.message') }}</th>
|
2023-11-23 17:37:06 +01:00
|
|
|
<th>{{ __('title.date') }}</th>
|
2022-04-09 19:08:53 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for c in conversations %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
2023-11-13 16:56:52 +01:00
|
|
|
{{ m.user(c.other_user, {'pronoun': true, 'url': url('/messages/' ~ c.other_user.id ~ '#newest')}) }}
|
2022-06-04 17:55:26 +02:00
|
|
|
|
2022-04-09 19:08:53 +02:00
|
|
|
{% if c.unread_messages > 0 %}
|
|
|
|
<span class="badge bg-danger">{{ c.unread_messages }}</span>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
<td>
|
2023-11-13 16:56:52 +01:00
|
|
|
<a href="{{ url('/messages/' ~ c.other_user.id ~ '#newest') }}">
|
2022-06-04 17:55:26 +02:00
|
|
|
{{ c.latest_message.text|length > 100 ? c.latest_message.text|slice(0, 100) ~ '…' : c.latest_message.text }}
|
2022-04-09 19:08:53 +02:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
<td>
|
2023-11-23 14:30:46 +01:00
|
|
|
{{ c.latest_message.created_at.format(__('general.datetime')) }}
|
2022-04-09 19:08:53 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{% endblock %}
|