diff --git a/assets/styles/app.scss b/assets/styles/app.scss index 3ddc605..722fa27 100644 --- a/assets/styles/app.scss +++ b/assets/styles/app.scss @@ -116,9 +116,16 @@ body { } } -.task-list__item form { +.task-list__item { display: flex; align-items: center; + gap: .5rem; +} + +.task-list__completion-form { + display: flex; + flex: 1; + align-items: center; gap: .75rem; } @@ -177,6 +184,31 @@ body { outline-offset: 3px; } +.task-list__remove { + display: grid; + place-items: center; + width: 2rem; + height: 2rem; + padding: 0; + cursor: pointer; + color: #ffe0e0; + background: transparent; + border: 0; + border-radius: .5rem; + transition: color .15s ease, background-color .15s ease, transform .15s ease; +} + +.task-list__remove:hover { + color: #fff; + background-color: #a71d1d; + transform: scale(1.08); +} + +.task-list__remove:focus-visible { + outline: 3px solid #fff; + outline-offset: 3px; +} + .task-list__title { color: inherit; } diff --git a/src/Controller/TaskController.php b/src/Controller/TaskController.php index 65c55e3..2ad3889 100644 --- a/src/Controller/TaskController.php +++ b/src/Controller/TaskController.php @@ -112,6 +112,10 @@ final class TaskController extends AbstractController $entityManager->flush(); } + if ($request->headers->has('HX-Request')) { + return new Response('', Response::HTTP_OK); + } + return $this->redirectToRoute('app_task_index', [], Response::HTTP_SEE_OTHER); } diff --git a/templates/task/_task_item.html.twig b/templates/task/_task_item.html.twig index 365dc04..337a564 100644 --- a/templates/task/_task_item.html.twig +++ b/templates/task/_task_item.html.twig @@ -1,5 +1,5 @@