wip: functionality for new role 'management'

This commit is contained in:
Björn Fromme
2024-02-14 16:41:36 +01:00
parent f32cfcd9f2
commit 2c02415056
14 changed files with 90 additions and 54 deletions
+3
View File
@@ -1,4 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="icon-dots" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z" />
</symbol>
<symbol id="icon-feedback" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 01.865-.501 48.172 48.172 0 003.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0012 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018z" />
</symbol>

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

@@ -32,7 +32,7 @@ class DeleteController extends AbstractController
'teamer' => (string) $application->getTeamer(),
]);
return $this->redirectToRoute('app_admin_assignment_detail', [
return $this->redirectToRoute('app_administrative_assignment_detail', [
'uuid' => $application->getAssignment()->getUuid(),
]);
}
@@ -44,7 +44,7 @@ class DisposeController extends AbstractController
'teamer' => (string) $application->getTeamer(),
]);
$redirectUrl = $this->generateUrl('app_admin_assignment_detail', [
$redirectUrl = $this->generateUrl('app_administrative_assignment_detail', [
'uuid' => $application->getAssignment()->getUuid(),
]);
@@ -51,7 +51,7 @@ class StatusController extends AbstractController
'teamer' => (string) $application->getTeamer(),
]);
return new HxRedirectResponse($this->generateUrl('app_admin_assignment_detail', [
return new HxRedirectResponse($this->generateUrl('app_administrative_assignment_detail', [
'uuid' => $application->getAssignment()->getUuid(),
]));
}
@@ -54,7 +54,7 @@ class DeleteController extends AbstractController
$this->entityManager->remove($disposition);
$this->entityManager->flush();
return new HxRedirectResponse($this->generateUrl('app_admin_assignment_detail', [
return new HxRedirectResponse($this->generateUrl('app_administrative_assignment_detail', [
'uuid' => $disposition->getAssignment()->getUuid(),
]));
}
@@ -1,6 +1,6 @@
<?php
namespace App\Controller\Admin\Teamer;
namespace App\Controller\Administrative\Teamer;
use App\Entity\Teamer;
use App\Repository\DispositionRepository;
@@ -14,13 +14,13 @@ class InfoController extends AbstractController
public function __construct(private readonly DispositionRepository $dispositionRepository)
{}
#[Route('/admin/teamer/info/{uuid}', name: 'app_admin_teamer_info')]
#[IsGranted('ROLE_ADMIN')]
#[Route('/administrative/teamer/info/{uuid}', name: 'app_administrative_teamer_info')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Teamer $teamer): Response
{
$recentDispositions = $this->dispositionRepository->findRecentDispositionsByTeamer($teamer);
return $this->render('admin/teamer/modal_info.html.twig', [
return $this->render('administrative/teamer/modal_info.html.twig', [
'teamer' => $teamer,
'recentDispositions' => $recentDispositions,
]);
+4 -4
View File
@@ -44,10 +44,10 @@ class AssignmentType extends AbstractType
'label' => 'zu vergeben',
'required' => false,
])
->add('showAvailableDispositions', CheckboxType::class, [
'label' => 'Anzahl anzeigen',
'required' => false,
])
// ->add('showAvailableDispositions', CheckboxType::class, [
// 'label' => 'Anzahl anzeigen',
// 'required' => false,
// ])
->add('destination', AutocompleteEntityType::class, [
'label' => 'Destination',
'class' => Destination::class,
+2 -1
View File
@@ -33,12 +33,13 @@ class AssignmentRepository extends ServiceEntityRepository
$qb = $this->createQueryBuilder('assignment');
$qb
->select('assignment', 'destination', 'job_profile', 'application', 'disposition')
->select('assignment', 'destination', 'job_profile', 'application', 'disposition', 'teamer')
->innerJoin('assignment.destination', 'destination')
->innerJoin('assignment.jobProfile', 'job_profile')
->where($qb->expr()->isNull('assignment.deletedAt'))
->leftJoin('assignment.applications', 'application')
->leftJoin('assignment.dispositions', 'disposition')
->leftJoin('disposition.teamer', 'teamer')
;
$this->applyFilterSettings($filterDto, $qb);
+7 -9
View File
@@ -1,15 +1,13 @@
<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">
<button type="button" class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-none focus:ring-0" aria-expanded="true" aria-haspopup="true">
<span class="sr-only">Funktionen</span>
{{ icon('menu', 'w-6 h-6') }}
{{ icon('dots', '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 class="hidden group-hover:block absolute right-0 top-0 z-10 w-56 origin-top-right pt-4" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
<div class="rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none">
<div class="py-1 menu menu--pulldown" role="none">
{% block items %}{% endblock %}
</div>
</div>
</div>
</div>
+1 -1
View File
@@ -77,7 +77,7 @@
role="button"
title="Bewerber:innen-Info anzeigen"
aria-label="Bewerber:innen-Info anzeigen"
hx-get="{{ path('app_admin_teamer_info', { 'uuid': application.teamer.uuid }) }}"
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': application.teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{% set requirementsMet = true %}
+1 -1
View File
@@ -51,7 +51,7 @@
{% if document.disposition %}
{% set url = path('app_administrative_assignment_detail', { 'uuid': document.disposition.assignment.uuid, 'r': return_url() }) %}
{% else %}
{% set url = path('app_admin_teamer_profile', { 'uuid': document.owner.teamer.uuid, 'r': return_url() }) %}
{% set url = path('app_administrative_teamer_profile', { 'uuid': document.owner.teamer.uuid, 'r': return_url() }) %}
{% endif %}
<a href="{{ url }}" class="flex items-center space-x-1 truncate">
{{ icon('download', 'w-4 h-4 shrink-0') }}
@@ -130,7 +130,7 @@
<button type="button"
class="flex items-center space-x-1"
title="Teamer:inneninfo {{ disposition.teamer }}"
hx-get="{{ path('app_admin_teamer_info', { 'uuid': disposition.teamer.uuid }) }}"
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': disposition.teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
<span>{{ disposition.teamer }}</span>
@@ -34,6 +34,9 @@
<table class="data-table">
<thead>
<tr>
<th>
Status
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Einsatz&shy;zeitraum', 'destination.dateFrom') }}
</th>
@@ -47,7 +50,10 @@
{{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }}
</th>
<th>
Bewerbungen<br>Status
Bewerbungen
</th>
<th>
Einteilungen
</th>
<th></th>
</tr>
@@ -55,6 +61,15 @@
<tbody>
{% for assignment in pagination %}
<tr>
<td>
{% if assignment.status == 'closed' %}
{{ icon('locked', 'w-4 h-4 text-red-500') }}
{% elseif assignment.status == 'draft' %}
{{ icon('hourglass', 'w-4 h-4 text-yellow-500') }}
{% else %}
{{ icon('unlocked', 'w-4 h-4') }}
{% endif %}
</td>
<td>
<a href="{{ path('app_administrative_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ assignment.effectivePeriod.start|date('d.m.Y') }} -
@@ -67,8 +82,6 @@
class="flex items-start space-x-2">
{{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }}
<div class="flex-1">
{{ assignment.destination.product }}
<br>
{{ assignment.destination.hotel }}
</div>
</a>
@@ -84,7 +97,7 @@
<a href="{{ path('app_administrative_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
<span class="whitespace-nowrap">ab {{ pickup.city }}</span>
<br>
{{ pickup.time }} Uhr
{{ pickup.time }}
</a>
{% else %}
-
@@ -92,39 +105,60 @@
</td>
<td>
<a href="{{ path('app_administrative_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-2">
<span>{{ assignment.validApplications|length }}/{{ assignment.availableDispositions - assignment.dispositions|length }}</span>
{% if assignment.status == 'closed' %}
{{ icon('locked', 'w-4 h-4 text-red-500') }}
{% elseif assignment.status == 'draft' %}
{{ icon('hourglass', 'w-4 h-4 text-yellow-500') }}
{% else %}
{{ icon('unlocked', 'w-4 h-4') }}
{% endif %}
<span>{{ assignment.validApplications|length }}</span>
</a>
</td>
<td>
<div class="flex items-center space-x-1 justify-end">
<span>{{ assignment.dispositions|length }}/{{ assignment.availableDispositions }}</span>
<ul>
{% for disposition in assignment.dispositions %}
<li>
<div role="button"
title="Teamer:innen-Info anzeigen"
aria-label="Teamer:innen-Info anzeigen"
hx-get="{{ path('app_administrative_teamer_info', { 'uuid': disposition.teamer.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
<span class="whitespace-nowrap">{{ disposition.teamer }}</span>
{% include '_partials/_rating_stars.html.twig' with { 'teamer': disposition.teamer } %}
</div>
</li>
{% endfor %}
</ul>
</td>
<td>
{% embed '_partials/_dropdown.html.twig' %}
{% block items %}
<button type="button"
class="text-red-500"
class="text-red-500 hover:text-primary block px-4 py-2 text-sm w-full text-left"
role="menuitem"
tabindex="-1"
hx-get="{{ path('app_administrative_assignment_delete', { 'uuid': assignment.uuid }) }}"
hx-target="body"
hx-swap="beforeend">
{{ icon('delete') }}
löschen
</button>
<a href="{{ path('app_administrative_assignment_duplicate', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ icon('copy', 'w-5 h-5') }}
<a href="{{ path('app_administrative_assignment_duplicate', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
class="text-gray-700 hover:text-primary block px-4 py-2 text-sm"
role="menuitem"
tabindex="-1">
duplizieren
</a>
{% if is_granted('EDIT', assignment) %}
<a href="{{ path('app_administrative_assignment_edit', { 'uuid': assignment.uuid, 'r': return_url() }) }}">
{{ icon('edit', 'w-5 h-5') }}
<a href="{{ path('app_administrative_assignment_edit', { 'uuid': assignment.uuid, 'r': return_url() }) }}"
class="text-gray-700 hover:text-primary block px-4 py-2 text-sm"
role="menuitem"
tabindex="-1">
bearbeiten
</a>
{% endif %}
</div>
{% endblock %}
{% endembed %}
</td>
</tr>
{% else %}
<tr>
<td colspan="6">
<td colspan="8">
Keine Daten...
</td>
</tr>