From 004b189be94cb0da5c5ef7d7f30b0c1c1e885871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 20 Oct 2023 13:54:52 +0200 Subject: [PATCH] Feat: Streamline layout for teamer --- .../Teamer/Application/IndexController.php | 1 + .../Teamer/Disposition/RecentController.php | 1 + .../Teamer/Disposition/UpcomingController.php | 1 + templates/teamer/application/index.html.twig | 142 +++++++----------- templates/teamer/disposition/_table.html.twig | 106 +++++-------- templates/teamer/index.html.twig | 4 +- 6 files changed, 99 insertions(+), 156 deletions(-) diff --git a/src/Controller/Teamer/Application/IndexController.php b/src/Controller/Teamer/Application/IndexController.php index 9c1a227..0aad37d 100644 --- a/src/Controller/Teamer/Application/IndexController.php +++ b/src/Controller/Teamer/Application/IndexController.php @@ -43,6 +43,7 @@ class IndexController extends AbstractController ); return $this->render('teamer/application/index.html.twig', [ + 'teamer' => $teamer, 'pagination' => $pagination, ]); } diff --git a/src/Controller/Teamer/Disposition/RecentController.php b/src/Controller/Teamer/Disposition/RecentController.php index c9bd1f8..0b09af9 100644 --- a/src/Controller/Teamer/Disposition/RecentController.php +++ b/src/Controller/Teamer/Disposition/RecentController.php @@ -43,6 +43,7 @@ class RecentController extends AbstractController ); return $this->render('teamer/disposition/recent.html.twig', [ + 'teamer' => $teamer, 'pagination' => $pagination, ]); } diff --git a/src/Controller/Teamer/Disposition/UpcomingController.php b/src/Controller/Teamer/Disposition/UpcomingController.php index 1efd9a7..cea139e 100644 --- a/src/Controller/Teamer/Disposition/UpcomingController.php +++ b/src/Controller/Teamer/Disposition/UpcomingController.php @@ -43,6 +43,7 @@ class UpcomingController extends AbstractController ); return $this->render('teamer/disposition/upcoming.html.twig', [ + 'teamer' => $teamer, 'pagination' => $pagination, ]); } diff --git a/templates/teamer/application/index.html.twig b/templates/teamer/application/index.html.twig index a8446ae..d150187 100644 --- a/templates/teamer/application/index.html.twig +++ b/templates/teamer/application/index.html.twig @@ -6,92 +6,60 @@

Meine offenen Bewerbungen

-
-
- - - - - - - - - - - - - - {% for application in pagination %} - {% set assignment = application.assignment %} - - - - - - - - - - {% else %} - - - - {% endfor %} - -
- {{ knp_pagination_sortable(pagination, 'Einsatz­beginn', 'assignment.dateFrom') }} - - {{ knp_pagination_sortable(pagination, 'Einsatz­ende', 'assignment.dateTo') }} - - {{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }} - - {{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }} - - {{ knp_pagination_sortable(pagination, 'Busbegleitung', 'assignment.pickup') }} - - {{ knp_pagination_sortable(pagination, 'Status', 'application.status') }} -
- {% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %} - {{ dateFrom|date('d.m.Y') }} - - {% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %} - {{ dateTo|date('d.m.Y') }} - - {{ assignment.jobProfile.name }} - - {{ assignment.destination.product }} -
- {{ assignment.destination.hotel }} -
- {{ assignment.pickup ? assignment.pickup|bpn_pickup_label|default('-') : '-' }} -
- {{ assignment.pickupDate ? assignment.pickupDate|date('d.m.Y') : '' }} -
- {{ ('label.application.status.' ~ application.status)|trans }} - -
- {% if is_granted('VIEW', application) %} - - {{ icon('info', 'w-5 h-5') }} - - {% endif %} - {% if is_granted('DELETE', application) %} - - {% endif %} -
-
- Keine Daten... -
- {{ knp_pagination_render(pagination) }} -
+
+ {% for application in pagination %} + {% set assignment = application.assignment %} +
+
+
+ {{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }} + {{ assignment.destination.product }} +
+
+ {{ icon('calendar', 'w-5 h-5 shrink-0') }} + {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }} +
+
+ {{ icon('profile', 'w-5 h-5 shrink-0') }} + {{ assignment.jobProfile.name }} +
+
+ {{ icon('house', 'w-5 h-5 shrink-0') }} + {{ assignment.destination.hotel }} +
+ {% if assignment.pickup %} +
+ {{ icon('bus', 'w-5 h-5 shrink-0') }} + {{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }} +
+ {% endif %} +
+
+ + {{ icon('info', 'w-4 h-4 shrink-0') }} + Details + + {% if is_granted('DELETE', application) %} + + {% endif %} +
+ {% if teamer.bookmarks.contains(assignment) %} + {{ icon('star', 'w-5 h-5 text-yellow-500 absolute top-0 right-0 mt-2 mr-2') }} + {% endif %} +
+ {% endfor %}
+ {{ knp_pagination_render(pagination, 'paginator/sliding_boxes.html.twig') }} {% endblock %} \ No newline at end of file diff --git a/templates/teamer/disposition/_table.html.twig b/templates/teamer/disposition/_table.html.twig index 0d296ed..6339849 100644 --- a/templates/teamer/disposition/_table.html.twig +++ b/templates/teamer/disposition/_table.html.twig @@ -1,68 +1,40 @@ -
-
- - - - - - - - - - - - - {% for disposition in pagination %} - {% set assignment = disposition.assignment %} - - - - - - - - - {% else %} - - - - {% endfor %} - -
- {{ knp_pagination_sortable(pagination, 'Einsatz­beginn', 'assignment.dateFrom') }} - - {{ knp_pagination_sortable(pagination, 'Einsatz­ende', 'assignment.dateTo') }} - - {{ knp_pagination_sortable(pagination, 'Jobprofil', 'assignment.jobProfile') }} - - {{ knp_pagination_sortable(pagination, 'Destination', 'destination.dateFrom') }} - - {{ knp_pagination_sortable(pagination, 'Busbegleitung ab', 'assignment.pickup') }} -
- {% set dateFrom = assignment.dateFrom ? assignment.dateFrom : assignment.destination.dateFrom %} - {{ dateFrom|date('d.m.Y') }} - - {% set dateTo = assignment.dateTo ? assignment.dateTo : assignment.destination.dateTo %} - {{ dateTo|date('d.m.Y') }} - - {{ assignment.jobProfile.name }} - - {{ assignment.destination.product }} -
- {{ assignment.destination.hotel }} -
- {{ assignment.pickup ? assignment.pickup|bpn_pickup_label|default('-') : '-' }} -
- {{ assignment.pickupDate ? assignment.pickupDate|date('d.m.Y') : '' }} -
- -
- Keine Daten... -
- {{ knp_pagination_render(pagination) }} -
+
+ {% for disposition in pagination %} + {% set assignment = disposition.assignment %} +
+
+
+ {{ icon('flag-' ~ assignment.destination.country, 'w-5 h-5 shrink-0') }} + {{ assignment.destination.product }} +
+
+ {{ icon('calendar', 'w-5 h-5 shrink-0') }} + {{ assignment.effectivePeriod.start|date('d.m.Y') }} - {{ assignment.effectivePeriod.end|date('d.m.Y') }} +
+
+ {{ icon('profile', 'w-5 h-5 shrink-0') }} + {{ assignment.jobProfile.name }} +
+
+ {{ icon('house', 'w-5 h-5 shrink-0') }} + {{ assignment.destination.hotel }} +
+ {% if assignment.pickup %} +
+ {{ icon('bus', 'w-5 h-5 shrink-0') }} + {{ assignment.pickup|bpn_pickup_label|default('-') }} {{ assignment.effectivePickupDate ? assignment.effectivePickupDate|date('d.m.Y') : '' }} +
+ {% endif %} +
+ + {{ icon('info', 'w-4 h-4 shrink-0') }} + Details + + {% if teamer.bookmarks.contains(assignment) %} + {{ icon('star', 'w-5 h-5 text-yellow-500 absolute top-0 right-0 mt-2 mr-2') }} + {% endif %} +
+ {% endfor %}
+{{ knp_pagination_render(pagination, 'paginator/sliding_boxes.html.twig') }} diff --git a/templates/teamer/index.html.twig b/templates/teamer/index.html.twig index 3b0a0fc..9dd7448 100644 --- a/templates/teamer/index.html.twig +++ b/templates/teamer/index.html.twig @@ -58,13 +58,13 @@ {% set label = 'eingeteilt' %} {% else %} {% set icon = 'info' %} - {% set class = 'btn--info' %} + {% set class = '' %} {% set url = path('app_teamer_assignment', { 'uuid': assignment.uuid, 'r': return_url() }) %} {% set label = 'bewerben' %} {% endif %} - {{ icon(icon, 'w-4 h-4') }} + {{ icon(icon, 'w-4 h-4 shrink-0') }} {{ label }}