feat: view and edit comments of uploaded documents

addresses #869eg7tv1
This commit is contained in:
Björn Fromme
2026-08-13 17:20:17 +02:00
parent 44fab8bf6c
commit 644bfa225d
5 changed files with 109 additions and 2 deletions
@@ -90,6 +90,16 @@
{{ icon('delete') }}
</button>
{% endif %}
{% if is_granted('COMMENT', upload) %}
<button type="button"
class="{{ html_classes({ 'text-gray-300': not upload.comment }) }}"
title="{{ upload.comment ? 'Kommentar bearbeiten' : 'Kommentar hinzufügen' }}"
hx-get="{{ path('app_administrative_document_comment', { 'uuid': upload.uuid, 'r': return_url() }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('feedback') }}
</button>
{% endif %}
<a href="{{ path('app_common_download', { 'uuid': upload.uuid, 'inline': false }) }}"
target="_blank"
title="Download und Markierung">
@@ -99,6 +99,16 @@
{{ icon('delete') }}
</button>
{% endif %}
{% if is_granted('COMMENT', upload) %}
<button type="button"
class="{{ html_classes({ 'text-gray-300': not upload.comment }) }}"
title="{{ upload.comment ? 'Kommentar bearbeiten' : 'Kommentar hinzufügen' }}"
hx-get="{{ path('app_administrative_document_comment', { 'uuid': upload.uuid, 'r': return_url() }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('feedback') }}
</button>
{% endif %}
{% if is_granted('CHECK', upload) %}
<button type="button"
hx-get="{{ path('app_administrative_document_check', { 'uuid': upload.uuid, 'r': return_url() }) }}"
@@ -0,0 +1,24 @@
{% extends 'htmx_modal.html.twig' %}
{% block title %}Kommentar{% endblock %}
{% block content %}
<a href="{{ path('app_common_download', { 'uuid': document.uuid, 'inline': true }) }}"
target="_blank"
class="flex justify-between items-center pb-4"
title="Dokument öffnen">
<h2 class="font-bold text-lg">
{{ ('label.document.type.' ~ document.type)|trans }} {{ document.disposition.teamer }} vom {{ document.createdAt|date('d.m.Y') }}
</h2>
{{ icon('eye') }}
</a>
{{ form_start(form) }}
<div class="pb-4">
{{ form_row(form.comment) }}
</div>
<button type="submit" class="btn">
Aktualisieren
</button>
{{ form_rest(form) }}
{{ form_end(form) }}
{% endblock %}