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') }}: {{ other_user.name }}{% endblock %}
|
2022-04-09 19:08:53 +02:00
|
|
|
|
|
|
|
{% block content %}
|
|
|
|
<div class="container">
|
|
|
|
<div class="page-header">
|
|
|
|
<h1>
|
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">
|
|
|
|
<div class="col-12 col-lg-8 offset-lg-2">
|
|
|
|
<div class="row conversation">
|
|
|
|
{% 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 %}">
|
|
|
|
<div class="message alert {% if own_message %}alert-primary{% else %}alert-secondary{% endif %}">
|
|
|
|
<p>{{ msg.text | nl2br }}</p>
|
|
|
|
<div class="text-end">
|
|
|
|
<small class="opacity-75">{{ msg.created_at.format(__('Y-m-d H:i')) }}</small>
|
|
|
|
{% if own_message %}
|
2022-06-04 17:55:26 +02:00
|
|
|
<form action="{{ url('/messages/' ~ other_user.id ~ '/' ~ msg.id) }}"
|
2022-06-06 16:07:03 +02:00
|
|
|
enctype="multipart/form-data" method="post" class="float-end"
|
2022-06-06 13:00:37 +02:00
|
|
|
>
|
2022-06-04 17:55:26 +02:00
|
|
|
{{ csrf() }}
|
|
|
|
{{ f.submit(m.icon('trash'), {'btn_type': 'primary', 'size': 'sm'}) }}
|
|
|
|
</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">
|
2022-06-06 13:00:37 +02:00
|
|
|
<label for="message" class="visually-hidden">{{ __('message.message') }}</label>
|
2022-06-06 16:07:03 +02:00
|
|
|
<textarea class="form-control" id="message" name="text" required="" rows="3"></textarea>
|
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 %}
|