WIP: Implement disosition document handling for admins

This commit is contained in:
Björn Fromme
2023-10-13 13:11:41 +02:00
parent 7ec12d6a3e
commit 858c9cbafd
5 changed files with 52 additions and 10 deletions
+2 -2
View File
@@ -1,9 +1,9 @@
.data-table-wrapper { .data-table-wrapper {
@apply overflow-x-auto mb-8; @apply overflow-x-auto lg:overflow-x-visible mb-8;
} }
.data-table-wrapper__inner { .data-table-wrapper__inner {
@apply align-middle inline-block min-w-full overflow-hidden; @apply align-middle inline-block min-w-full overflow-hidden lg:overflow-visible;
} }
table { table {
@@ -0,0 +1,31 @@
<?php
namespace App\Controller\Admin\Document;
use App\Entity\Upload;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class DeleteController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly LoggerInterface $logger
)
{
}
#[Route('/admin/document/delete/{uuid}', name: 'app_admin_document_delete')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Upload $document): Response
{
$this->entityManager->remove($document);
$this->entityManager->flush();
return $this->render('');
}
}
+15
View File
@@ -0,0 +1,15 @@
<div class="relative inline-block text-left group">
<button type="button" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 focus:ring-offset-gray-100" id="menu-button" aria-expanded="true" aria-haspopup="true">
<span class="sr-only">Funktionen</span>
{{ icon('menu', 'w-6 h-6') }}
</button>
<div class="hidden group-hover:block absolute right-0 z-10 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
<div class="py-1" role="none">
{% for item in links %}
<a href="{{ item.url }}" class="text-gray-700 hover:bg-gray-100 hover:text-gray-900 block px-4 py-2 text-sm" role="menuitem" tabindex="-1"{% if item.target is defined %} target="{{ item.target }}"{% endif %}>
{{ item.label }}
</a>
{% endfor %}
</div>
</div>
</div>
+3 -7
View File
@@ -60,13 +60,9 @@
{{ upload.status|upload_status_badge }} {{ upload.status|upload_status_badge }}
</td> </td>
<td> <td>
<div class="flex items-center space-x-2"> {% include '_partials/_dropdown.html.twig' with { 'links': [
<a href="{{ path('app_common_download', { 'uuid': upload.uuid }) }}" { 'url': path('app_common_download', { 'uuid': upload.uuid }), 'label': 'Download', 'target': '_blank' },
title="Download" ] } %}
target="_blank">
{{ icon('download') }}
</a>
</div>
</td> </td>
</tr> </tr>
{% else %} {% else %}
+1 -1
View File
@@ -1,7 +1,7 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block body %} {% block body %}
<div class="container grid lg:grid-cols-4 gap-8 py-8"> <div class="container lg:grid lg:grid-cols-4 gap-8 py-8">
<div class="lg:col-span-4 flex items-center justify-between"> <div class="lg:col-span-4 flex items-center justify-between">
<a href="{{ path(app.user.defaultRoute) }}"> <a href="{{ path(app.user.defaultRoute) }}">
<img class="h-8 w-auto" src="{{ asset('build/images/logo.svg') }}" alt="My E&amp;P Team"> <img class="h-8 w-auto" src="{{ asset('build/images/logo.svg') }}" alt="My E&amp;P Team">