{% if pmView == 'new' %}{{ t('pm_new_title') }}{% elseif pmView == 'read' %}{{ t('pm_read') }}{% elseif pmView == 'sent' %}{{ t('pm_sent_title') }}{% else %}{{ t('pm_inbox') }}{% endif %}
{{ t('pm_eingang') }} {{ t('pm_gesendet') }} {{ t('pm_neue_pn') }}
{% if pmView == 'new' %}
{% if error %}
{{ error }}
{% endif %}
{{ render_editor('content', 'content', formContent ?? '', t('pm_platzhalter'), true, false)|raw }}
{{ t('pm_abbrechen') }}
{% elseif pmView == 'read' %} {% set isSenderView = currentUser and currentUser.user_id == pm.sender_id %}

{{ pm.subject }}

{% if isSenderView %} An {{ pm.receiver_name }} {% else %} Von {{ pm.sender_name }} {% endif %} • {{ format_date(pm.sent_at) }} {% if isSenderView %} • {{ pm.is_read ? t('pm_gelesen') : t('pm_ungelesen') }} {% endif %}


{{ bbcode(pm.content)|raw }}

{% if not isSenderView %} {{ t('pm_antworten') }} {% endif %} {{ t('pm_loeschen') }} {{ t('pm_zurueck') }}
{% else %}
{% if not messages %}
{{ t('pm_keine_nachrichten') }}
{% endif %} {% for msg in messages %}
{% if not msg.is_read and pmView != 'sent' %}{% endif %}{{ msg.subject }}
{{ pmView == 'sent' ? t('pm_an') : t('pm_von') }}: {{ msg.other_name }}
{{ format_date(msg.sent_at) }}
✕
{% endfor %}
{% endif %}