Skip to content
Snippets Groups Projects

Persönliche Nachrichten überarbeiten

Files

{% import "plainui/components/function_btns.html.j2" as fbtns with context %}
{% import "plainui/components/nav.html.j2" as navMacro with context %}
{% import "plainui/components/tagbox.html.j2" as tagboxMacro %}
{% extends "plainui/base.html.j2" %}
@@ -10,149 +11,136 @@
{% block content %}
{{ navMacro.top_nav(_("Personal Messages") ) }}
<div class="m-0 my-6 p-0 text-left">
<ul class="m-0 d-flex list-unstyled">
{% if sent_mode %}
<li class="py-2">
<a role="button"
class="a a-bold"
<div>
<div class="d-flex">
<ul class="nav nav-pills mb-3">
<li class="nav-item">
<a class="nav-link {% if not sent_mode %}active{% endif %}"
href="{{ url('plainui:personal_message') }}">{{ _("Inbox") }}</a>
</li>
{% endif %}
{% if not sent_mode %}
<li class="py-2">
<a role="button"
class="a a-bold"
<li class="nav-item">
<a class="nav-link {% if sent_mode %}active{% endif %}"
href="{{ url('plainui:personal_message_outbox') }}">{{ _("Outbox") }}</a>
</li>
{% endif %}
<li class="ms-auto py-2">
<a role="button"
class="btn"
href="{{ url('plainui:personal_message_send') }}">{{ _("New PM") }}</a>
</li>
</ul>
</div>
<li class="nav-item">
<a class="nav-link" href="{{ url('plainui:personal_message_send') }}">{{ _("New PM") }}</a>
</li>
</ul>
<div class="border p-0 mx-0 mb-11">
<h2 class="bg-secondary text-center text-dark m-0 px-3 py-1">
{% if not sent_mode %}
{{ _("Received Messages") }}
{% else %}
{{ _("Sent Messages") }}
{% endif %}
</h2>
<form method="post"
action="{{ url('plainui:personal_message_delete') }}"
class="p-3">
{{ csrf_input }}
<p class="mb-3 font-headings text-white text-right p-0">{{ msgs | length }} {{ _("messages_x_of_n") }} {{ total }}</p>
<ul class="list-unstyled mb-0">
{%- for msg in msgs %}
<li class="hub-tile-message card mb-5">
<article class="row no-gutters flex-nowrap">
<figure class="hub-tile-message__icon-col col mb-0">
<a class="hub-tile-message__icon-container text-white"
href="{{ url('plainui:personal_message_show', msg_id=msg.id) }}">
{% if not sent_mode %}
{% if msg.has_responded %}
<svg class="hub-tile-message__icon-flag bi bi-reply-fill"
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_was_responded") }}</title>
<path transform="translate(16), scale(-1, 1)" d="M9.079 11.9l4.568-3.281a.719.719 0 0 0 0-1.238L9.079 4.1A.716.716 0 0 0 8 4.719V6c-1.5 0-6 0-7 8 2.5-4.5 7-4 7-4v1.281c0 .56.606.898 1.079.62z" />
</svg>
{% endif %}
{% if msg.was_read %}
<svg class="hub-tile-message__icon bi bi-envelope-open"
xmlns="http://www.w3.org/2000/svg"
width="3.125rem"
height="3.125rem"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_was_read") }}</title>
<path d="M8.47 1.318a1 1 0 0 0-.94 0l-6 3.2A1 1 0 0 0 1 5.4v.818l5.724 3.465L8 8.917l1.276.766L15 6.218V5.4a1 1 0 0 0-.53-.882l-6-3.2zM15 7.388l-4.754 2.877L15 13.117v-5.73zm-.035 6.874L8 10.083l-6.965 4.18A1 1 0 0 0 2 15h12a1 1 0 0 0 .965-.738zM1 13.117l4.754-2.852L1 7.387v5.73zM7.059.435a2 2 0 0 1 1.882 0l6 3.2A2 2 0 0 1 16 5.4V14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V5.4a2 2 0 0 1 1.059-1.765l6-3.2z" />
</svg>
</div>
{% if msgs %}
<form method="post" action="{{ url('plainui:personal_message_delete') }}">
{{ csrf_input }}
<ul class="hub-list">
{%- for msg in msgs %}
<li class="hub-list-item hub-grid-title-buttons">
<article class="row flex-column flex-lg-row no-gutters flex-nowrap">
<figure class="hub-tile-message__icon-col col mb-0 d-none d-lg-flex">
<a class="hub-tile-message__icon-container text-white"
href="{{ url('plainui:personal_message_show', msg_id=msg.id) }}">
{% if not sent_mode %}
{% if msg.has_responded %}
<svg class="hub-tile-message__icon-flag bi bi-reply-fill"
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_was_responded") }}</title>
<path transform="translate(16), scale(-1, 1)" d="M9.079 11.9l4.568-3.281a.719.719 0 0 0 0-1.238L9.079 4.1A.716.716 0 0 0 8 4.719V6c-1.5 0-6 0-7 8 2.5-4.5 7-4 7-4v1.281c0 .56.606.898 1.079.62z" />
</svg>
{% endif %}
{% if msg.was_read %}
<svg class="hub-tile-message__icon bi bi-envelope-open"
xmlns="http://www.w3.org/2000/svg"
width="3.125rem"
height="3.125rem"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_was_read") }}</title>
<path d="M8.47 1.318a1 1 0 0 0-.94 0l-6 3.2A1 1 0 0 0 1 5.4v.818l5.724 3.465L8 8.917l1.276.766L15 6.218V5.4a1 1 0 0 0-.53-.882l-6-3.2zM15 7.388l-4.754 2.877L15 13.117v-5.73zm-.035 6.874L8 10.083l-6.965 4.18A1 1 0 0 0 2 15h12a1 1 0 0 0 .965-.738zM1 13.117l4.754-2.852L1 7.387v5.73zM7.059.435a2 2 0 0 1 1.882 0l6 3.2A2 2 0 0 1 16 5.4V14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V5.4a2 2 0 0 1 1.059-1.765l6-3.2z" />
</svg>
{% else %}
<svg class="hub-tile-message__icon bi bi-envelope-fill"
xmlns="http://www.w3.org/2000/svg"
width="3.125rem"
height="3.125rem"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_is_new") }}</title>
<path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555zM0 4.697v7.104l5.803-3.558L0 4.697zM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757zm3.436-.586L16 11.801V4.697l-5.803 3.546z" />
</svg>
{% endif %}
{% else %}
<svg class="hub-tile-message__icon bi bi-envelope-fill"
<svg class="hub-tile-message__icon bi bi-mailbox"
xmlns="http://www.w3.org/2000/svg"
width="3.125rem"
height="3.125rem"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_is_new") }}</title>
<path d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555zM0 4.697v7.104l5.803-3.558L0 4.697zM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757zm3.436-.586L16 11.801V4.697l-5.803 3.546z" />
<title>{{ _("messages_was_sent") }}</title>
<path fill-rule="evenodd" d="M6 8a.5.5 0 0 0 .5.5h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L12.293 7.5H6.5A.5.5 0 0 0 6 8zm-2.5 7a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5z" />
</svg>
{% endif %}
{% else %}
<svg class="hub-tile-message__icon bi bi-mailbox"
xmlns="http://www.w3.org/2000/svg"
width="3.125rem"
height="3.125rem"
fill="currentColor"
viewBox="0 0 16 16">
<title>{{ _("messages_was_sent") }}</title>
<path fill-rule="evenodd" d="M6 8a.5.5 0 0 0 .5.5h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L12.293 7.5H6.5A.5.5 0 0 0 6 8zm-2.5 7a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 1 0v13a.5.5 0 0 1-.5.5z" />
</svg>
{% endif %}
</a>
</figure>
<section class="col pt-3 px-2">
</a>
</figure>
<section class="col">
<a class="text-white d-block mb-2 mb-lg-0"
href="{{ url('plainui:personal_message_show', msg_id=msg.id) }}">
<p class="card-title h4 text-white">{{ msg.subject }}</p>
</a>
{% set recipient = msg.sender.display_name if not sent_mode else msg.recipient.display_name %}
{% set recipient_pronouns = msg.sender.pronouns if not sent_mode else msg.recipient.pronouns %}
{% set recipient_slug = msg.sender.slug if not sent_mode else msg.recipient.slug %}
<footer class="card-footer d-flex flex-column flex-lg-row align-items-lg-center bg-transparent text-white font-sans-serif fs-medium gap-2">
<div class="d-md-flex">
<div class="me-2">
{{ tagboxMacro.user(msg.sender.get_display_name() ,
link=url('plainui:user', user_slug=msg.sender.slug)
) }}
</div>
<a class="text-white"
href="{{ url('plainui:personal_message_show', msg_id=msg.id) }}">
<p class="px-2 card-title h4 text-white">{{ msg.subject }}</p>
</a>
<footer class="card-footer d-flex align-items-center bg-transparent text-white font-sans-serif fs-medium">
<a class="pe-1 a a-bold"
href="{{ url('plainui:user', user_slug=recipient_slug) }}">{{ recipient }},</a>
<time datetime="{{ msg.timestamp }}">{{ msg.timestamp | strftime }}</time>
<div class="d-inline-flex ms-auto">
<a class="me-2 btn-icon-big btn btn-transparent"
title="{{ _('read') }}"
href="{{ url('plainui:personal_message_show', msg_id=msg.id) }}">
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-chevron-double-right"
viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708z" />
<path fill-rule="evenodd" d="M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708z" />
</svg>
</a>
<button class="me-2 btn-icon-big btn btn-transparent"
type="submit"
name="id"
value="{{ msg.id }}"
title="{{ _('messages_delete') }}">
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-trash"
viewBox="0 0 16 16">
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
</svg>
</button>
{% if not sent_mode %}{{ fbtns.report(report_url=msg.id, kind="pn", title=_("report this message") ) }}{% endif %}
</div>
</footer>
</section>
</article>
</li>
{%- endfor %}
</ul>
<p class="font-headings text-white text-right p-0">{{ msgs | length }} {{ _("messages_x_of_n") }} {{ total }}</p>
</form>
<time datetime="{{ msg.timestamp }}">{{ msg.timestamp | strftime }}</time>
</div>
<div class="d-inline-flex ms-lg-auto">
<a class="me-2 btn-icon-big btn btn-transparent"
title="{{ _('read') }}"
href="{{ url('plainui:personal_message_show', msg_id=msg.id) }}">
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-chevron-double-right"
viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M3.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L9.293 8 3.646 2.354a.5.5 0 0 1 0-.708z" />
<path fill-rule="evenodd" d="M7.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L13.293 8 7.646 2.354a.5.5 0 0 1 0-.708z" />
</svg>
</a>
<button class="me-2 btn-icon-big btn btn-transparent"
type="submit"
name="id"
value="{{ msg.id }}"
title="{{ _('messages_delete') }}">
<svg xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
fill="currentColor"
class="bi bi-trash"
viewBox="0 0 16 16">
<path d="M5.5 5.5A.5.5 0 0 1 6 6v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm2.5 0a.5.5 0 0 1 .5.5v6a.5.5 0 0 1-1 0V6a.5.5 0 0 1 .5-.5zm3 .5a.5.5 0 0 0-1 0v6a.5.5 0 0 0 1 0V6z" />
<path fill-rule="evenodd" d="M14.5 3a1 1 0 0 1-1 1H13v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4h-.5a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1H6a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1h3.5a1 1 0 0 1 1 1v1zM4.118 4L4 4.059V13a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V4.059L11.882 4H4.118zM2.5 3V2h11v1h-11z" />
</svg>
</button>
{% if not sent_mode %}{{ fbtns.report(report_url=msg.id, kind="pn", title=_("report this message") ) }}{% endif %}
</div>
</footer>
</section>
</article>
</li>
{%- endfor %}
</ul>
<p class="font-headings text-white text-end pt-2">{{ msgs | length }} {{ _("messages_x_of_n") }} {{ total }}</p>
</form>
{% else %}
<p class="hub-empty-section">{{ _("No entries available.") }}</p>
{% endif %}
</div>
{% endblock content %}
Loading