Feat: Add teamer info popup

This commit is contained in:
Björn Fromme
2023-10-20 11:08:23 +02:00
parent 67cc7bf4ed
commit 2d657611fa
9 changed files with 137 additions and 34 deletions
+11 -1
View File
@@ -4,17 +4,27 @@ namespace App\Controller\Admin\Teamer;
use App\Entity\Teamer;
use App\Model\AjaxModalResponseDto;
use App\Repository\DispositionRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route;
class InfoController extends AbstractController
{
public function __construct(private readonly DispositionRepository $dispositionRepository)
{}
#[Route('/admin/teamer/info/{uuid}', name: 'app_admin_teamer_info')]
public function index(Teamer $teamer): JsonResponse
{
$response = new AjaxModalResponseDto();
$recentDispositions = $this->dispositionRepository->getRecentByTeamer($teamer);
$response = new AjaxModalResponseDto();
$response->setContent($this->renderView('admin/teamer/info.html.twig', [
'teamer' => $teamer,
'recentDispositions' => $recentDispositions,
]));
return $this->json($response);
}
}