feat: feedback details for role 'administrative'
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller\Administrative\Feedback;
|
||||
|
||||
use App\Entity\Feedback;
|
||||
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 DetailController extends AbstractController
|
||||
{
|
||||
|
||||
#[Route('/administrative/feedback/detail/{uuid}', name: 'app_administrative_feedback_detail')]
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Feedback $feedback): Response
|
||||
{
|
||||
return $this->render('administrative/feedback/modal_info.html.twig', [
|
||||
'feedback' => $feedback,
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class IndexController extends AbstractController
|
||||
{
|
||||
@@ -18,6 +19,7 @@ class IndexController extends AbstractController
|
||||
}
|
||||
|
||||
#[Route('/administrative/feedback', name: 'app_administrative_feedback_index')]
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$query = $this
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
{{ knp_pagination_sortable(pagination, 'Haus', 'feedback.hotel') }}
|
||||
</th>
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Note', 'feedback.averageRating') }}
|
||||
{{ knp_pagination_sortable(pagination, 'Bewertung', 'feedback.averageRating') }}
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
@@ -61,6 +61,12 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<button type="button"
|
||||
hx-get="{{ path('app_administrative_feedback_detail', { 'uuid': feedback.uuid }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('info', 'w-4 h-4') }}
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends 'htmx_modal.html.twig' %}
|
||||
|
||||
{% block title %}Feedback zu {{ feedback.teamer }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="text-lg pb-4">
|
||||
Einsatz: {{ feedback.destinationName }}
|
||||
<br>
|
||||
Einsatzzeitraum: {{ feedback.assignmentDateFrom|date('d.m.Y') }} - {{ feedback.assignmentDateTo|date('d.m.Y') }}
|
||||
<br>
|
||||
Feedback von: {{ feedback.author }}
|
||||
</div>
|
||||
<table>
|
||||
{% for entry in feedback.ratings %}
|
||||
<tr>
|
||||
<td class="border-r border-gray-300">
|
||||
{{ entry.rating }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ entry.mark }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user