WIP: Implement disosition document handling for admins
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
.data-table-wrapper {
|
||||
@apply overflow-x-auto mb-8;
|
||||
@apply overflow-x-auto lg:overflow-x-visible mb-8;
|
||||
}
|
||||
|
||||
.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 {
|
||||
|
||||
@@ -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('');
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -60,13 +60,9 @@
|
||||
{{ upload.status|upload_status_badge }}
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2">
|
||||
<a href="{{ path('app_common_download', { 'uuid': upload.uuid }) }}"
|
||||
title="Download"
|
||||
target="_blank">
|
||||
{{ icon('download') }}
|
||||
</a>
|
||||
</div>
|
||||
{% include '_partials/_dropdown.html.twig' with { 'links': [
|
||||
{ 'url': path('app_common_download', { 'uuid': upload.uuid }), 'label': 'Download', 'target': '_blank' },
|
||||
] } %}
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% 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">
|
||||
<a href="{{ path(app.user.defaultRoute) }}">
|
||||
<img class="h-8 w-auto" src="{{ asset('build/images/logo.svg') }}" alt="My E&P Team">
|
||||
|
||||
Reference in New Issue
Block a user