fix: retain pagination and sorting when navigating using submenu
This commit is contained in:
@@ -51,7 +51,9 @@ class DeleteController extends AbstractController
|
||||
'teamer_name' => (string) $teamer,
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->getReturnUrl($request, 'app_admin_teamer_profile', ['uuid' => $teamer->getUuid()]);
|
||||
$redirectUrl = $this->getReturnUrl($request, 'app_admin_teamer_profile', [
|
||||
'uuid' => $teamer->getUuid(),
|
||||
]);
|
||||
|
||||
return new HxRedirectResponse($redirectUrl);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller\Admin\Teamer\TrainingAttendance;
|
||||
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\JobProfile;
|
||||
use App\Entity\Teamer;
|
||||
use App\Entity\Training;
|
||||
@@ -19,6 +20,8 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class CreateController extends AbstractController
|
||||
{
|
||||
use ReturnUrlTrait;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger
|
||||
@@ -67,7 +70,9 @@ class CreateController extends AbstractController
|
||||
'training_name' => $training->getName(),
|
||||
]);
|
||||
|
||||
$redirectUrl = $this->generateUrl('app_admin_teamer_skills', ['uuid' => $teamer->getUuid()]);
|
||||
$redirectUrl = $this->getReturnUrl($request, 'app_admin_teamer_skills', [
|
||||
'uuid' => $teamer->getUuid(),
|
||||
]);
|
||||
|
||||
return new HxRedirectResponse($redirectUrl);
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Controller\Admin\Teamer\TrainingAttendance;
|
||||
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\TrainingAttendance;
|
||||
use App\Htmx\HxRedirectResponse;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@@ -14,6 +15,8 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
|
||||
class DeleteController extends AbstractController
|
||||
{
|
||||
use ReturnUrlTrait;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly LoggerInterface $logger
|
||||
@@ -39,9 +42,11 @@ class DeleteController extends AbstractController
|
||||
'training_name' => $attendance->getTraining()->getName(),
|
||||
]);
|
||||
|
||||
return new HxRedirectResponse($this->generateUrl('app_admin_teamer_skills', [
|
||||
$returnUrl = $this->getReturnUrl($request, 'app_admin_teamer_skills', [
|
||||
'uuid' => $teamer->getUuid(),
|
||||
]));
|
||||
]);
|
||||
|
||||
return new HxRedirectResponse($returnUrl);
|
||||
}
|
||||
|
||||
return $this->render('admin/teamer/training_attendance/modal_delete.html.twig', [
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<button type="button"
|
||||
class="text-red-500"
|
||||
title="Ausbildung löschen"
|
||||
hx-get="{{ path('app_admin_teamer_skills_training_attendance_delete', { 'uuid': attendance.uuid }) }}"
|
||||
hx-get="{{ path('app_admin_teamer_skills_training_attendance_delete', { 'uuid': attendance.uuid, 'r': return_url() }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('delete') }}
|
||||
@@ -36,7 +36,7 @@
|
||||
{% else %}
|
||||
<button type="button"
|
||||
title="Teilnahme hinzufügen"
|
||||
hx-get="{{ path('app_admin_teamer_skills_training_attendance_create', { 'training_id': training.id, 'teamer_id': teamer.id }) }}"
|
||||
hx-get="{{ path('app_admin_teamer_skills_training_attendance_create', { 'training_id': training.id, 'teamer_id': teamer.id, 'r': return_url() }) }}"
|
||||
hx-target="body"
|
||||
hx-swap="beforeend">
|
||||
{{ icon('calendar', 'w-4 h-4') }}
|
||||
|
||||
Reference in New Issue
Block a user