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-07-10 21:12:10 +02:00
|
|
|
{% block title %}{{ __('message.title') }}: {{ other_user.displayName }}{% endblock %}
|
2022-04-09 19:08:53 +02:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container">
|
|
|
|
<div class="page-header">
|
|
|
|
<h1>
|
2024-05-22 18:29:32 +02:00
|
|
|
{{ m.back(url('/messages')) }}
|
2022-06-06 13:00:37 +02:00
|
|
|
{{ __('message.title') }}: {{ m.user(other_user, {'pronoun': true}) }}
|
2022-04-09 19:08:53 +02:00
|
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
2023-01-17 15:05:47 +01:00
|
|
|
<div class="col-12 col-lg-10 col-xl-8 offset-lg-1 offset-xl-2">
|
|
|
|
<div class="row conversation mb-2">
|
2022-04-09 19:08:53 +02:00
|
|
|
{% for msg in messages %}
|
2022-06-06 16:07:03 +02:00
|
|
|
{% set own_message = msg.user_id == user.id %}
|
|
|
|
<div class="col-12"{% if loop.last %} id="newest"{% endif %}>
|
|
|
|
<div class="d-flex{% if own_message %} justify-content-end{% endif %}">
|
2023-01-17 15:05:47 +01:00
|
|
|
<div class="card {% if own_message %}text-bg-primary{% else %}text-bg-secondary{% endif %} mb-3">
|
|
|
|
<div class="card-body">
|
|
|
|
<p class="card-text">{{ msg.text | nl2br }}</p>
|
|
|
|
</div>
|
|
|
|
<div class="card-footer d-flex justify-content-end align-items-center fw-light">
|
2023-11-23 14:30:46 +01:00
|
|
|
<small class="opacity-75">{{ msg.created_at.format(__('general.datetime')) }}</small>
|
2022-06-06 16:07:03 +02:00
|
|
|
{% if own_message %}
|
2022-06-04 17:55:26 +02:00
|
|
|
<form action="{{ url('/messages/' ~ other_user.id ~ '/' ~ msg.id) }}"
|
2023-01-17 15:05:47 +01:00
|
|
|
enctype="multipart/form-data" method="post" class="ms-2"
|
2022-06-06 13:00:37 +02:00
|
|
|
>
|
2022-06-04 17:55:26 +02:00
|
|
|
{{ csrf() }}
|
2023-12-21 13:08:29 +01:00
|
|
|
{{ f.delete(null, {'btn_type': 'sm btn-danger'}) }}
|
2022-06-04 17:55:26 +02:00
|
|
|
</form>
|
2022-06-04 22:42:52 +02:00
|
|
|
{% endif %}
|
|
|
|
</div>
|
2022-06-06 16:07:03 +02:00
|
|
|
{% if not own_message and msg.read == false %}
|
|
|
|
<span class="position-absolute top-0 start-100 translate-middle-x p-2 bg-danger rounded-circle"></span>
|
|
|
|
{% endif %}
|
2022-06-04 22:42:52 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-06 16:07:03 +02:00
|
|
|
</div>
|
2022-06-04 17:55:26 +02:00
|
|
|
{% endfor %}
|
|
|
|
</div>
|
2022-04-09 19:08:53 +02:00
|
|
|
|
2022-06-04 17:55:26 +02:00
|
|
|
<form action="" enctype="multipart/form-data" method="post">
|
|
|
|
{{ csrf() }}
|
2022-04-09 19:08:53 +02:00
|
|
|
|
2022-06-04 17:55:26 +02:00
|
|
|
<div class="input-group">
|
2023-12-16 03:07:16 +01:00
|
|
|
{{ f.textarea(
|
|
|
|
'text',
|
|
|
|
__('message.message'),
|
|
|
|
{'required': true, 'rows': 3, 'label_hidden': true, 'no_div': true}
|
|
|
|
) }}
|
2022-06-04 17:55:26 +02:00
|
|
|
{{ f.submit(m.icon('send-fill')) }}
|
|
|
|
</div>
|
|
|
|
</form>
|
2022-04-09 19:08:53 +02:00
|
|
|
</div>
|
2022-06-04 17:55:26 +02:00
|
|
|
</div>
|
2022-04-09 19:08:53 +02:00
|
|
|
</div>
|
|
|
|
{% endblock %}
|