feat: global documents for teamers

This commit is contained in:
Björn Fromme
2024-01-31 18:21:12 +01:00
parent 5d636108a1
commit e984497a29
4 changed files with 59 additions and 2 deletions
@@ -0,0 +1,27 @@
<?php
namespace App\Controller\Teamer;
use App\Repository\UploadRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class DocumentController extends AbstractController
{
public function __construct(private readonly UploadRepository $uploadRepository)
{
}
#[Route('/teamer/document', name: 'app_teamer_document')]
#[IsGranted('ROLE_USER')]
public function index(): Response
{
$documents = $this->uploadRepository->getGlobal();
return $this->render('teamer/document/index.html.twig', [
'documents' => $documents,
]);
}
}
+5
View File
@@ -76,6 +76,11 @@ class TeamerMenuBuilder extends AbstractMenuBuilder
],
],
],
[
'route' => 'app_teamer_document',
'title' => 'Dokumente',
'icon' => 'document',
],
[
'route' => false,
'title' => 'FAQ &amp; Kontakt',
+1 -2
View File
@@ -29,9 +29,8 @@ class DispositionRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('disposition');
return $qb
->select('disposition', 'assignment', 'job_profile', 'destination', 'documents')
->select('disposition', 'assignment', 'job_profile', 'destination')
->innerJoin('disposition.assignment', 'assignment')
->leftJoin('assignment.documents', 'documents')
->innerJoin('assignment.jobProfile', 'job_profile')
->innerJoin('assignment.destination', 'destination')
->where($qb->expr()->andX(
+26
View File
@@ -0,0 +1,26 @@
{% extends 'teamer/layout.html.twig' %}
{% block title %}Dokumente{% endblock %}
{% block content %}
<div class="max-w-screen-md mx-auto">
<h1 class="text-2xl font-bold pb-8">
Dokumente zum Nachlesen
</h1>
<dl class="divide-y divide-gray-100">
{% for document in documents %}
<div class="py-6 first:pt-0 last:pb-0 sm:grid sm:grid-cols-3 sm:gap-4">
<dt class="font-bold leading-6 text-gray-900 sm:col-span-2 whitespace-nowrap">
{{ document.displayName | default(document.originalFilename) }}
</dt>
<dd class="mt-1 text-sm leading-6 text-gray-700 sm:mt-0">
<a href="{{ path('app_common_download', { 'uuid': document.uuid }) }}" class="flex items-center space-x-1">
{{ icon('download') }}
<span class="flex-shrink-0">Download</span>
</a>
</dd>
</div>
{% endfor %}
</dl>
</div>
{% endblock %}