Files
myep-team/templates/admin/system/document/index.html.twig
T
2023-10-16 12:05:18 +02:00

100 lines
4.6 KiB
Twig

{% extends 'admin/layout.html.twig' %}
{% block title %}Dokumentenübersicht{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Dokumentenübersicht
</h1>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Dateiname', 'upload.originalFilename') }}
</th>
<th>
Dateigröße
</th>
<th>
Upload am
</th>
<th>
Upload von
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for document in pagination %}
<tr>
<td>
{{ document.displayName ? document.displayName : document.originalFilename }}
</td>
<td>
{{ document.size|file_size }}
</td>
<td>
{{ document.createdAt|date('d.m.Y') }}
</td>
<td>
{{ document.createdBy }}
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
<button type="button"
class="text-red-500"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?',
'content': 'Möchtest du das Dokument wirklich löschen?',
'target-url': path('app_admin_system_document_delete', { 'uuid': document.uuid })
}) }}>
{{ icon('delete') }}
</button>
<button type="button"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Dokument ersetzen',
'url': path('app_admin_system_document_replace', { 'uuid': document.uuid })
}) }}>
{{ icon('refresh') }}
</button>
<button type="button"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Dokument umbenennen',
'url': path('app_admin_system_document_rename', { 'uuid': document.uuid })
}) }}>
{{ icon('edit') }}
</button>
<a href="{{ path('app_common_download', { 'uuid': document.uuid }) }}"
title="Download">
{{ icon('download') }}
</a>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="7">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
<button type="button"
class="btn"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Dokumente hinzufügen',
'url': path('app_admin_system_document_upload')
}) }}>
Dokumente hinzufügen
</button>
{% endblock %}