diff --git a/assets/styles/_components.css b/assets/styles/_components.css index f35b6ba..5100426 100644 --- a/assets/styles/_components.css +++ b/assets/styles/_components.css @@ -3,4 +3,5 @@ @import "components/button.css"; @import "components/menu.css"; @import "components/toast.css"; -@import "components/tooltip.css"; \ No newline at end of file +@import "components/tooltip.css"; +@import "components/table-responsive.css"; \ No newline at end of file diff --git a/assets/styles/components/menu.css b/assets/styles/components/menu.css index 66fe089..c0a27e9 100644 --- a/assets/styles/components/menu.css +++ b/assets/styles/components/menu.css @@ -1,9 +1,9 @@ .menu--main { - @apply lg:flex lg:items-center m-0; + @apply flex items-center m-0; } .menu--main a { - @apply block p-4 text-black hover:bg-zinc-400 hover:text-zinc-800; + @apply block p-2 md:p-4 text-black hover:bg-zinc-400 hover:text-zinc-800 text-sm md:text-base; } .menu--main .current a { diff --git a/assets/styles/components/table-responsive.css b/assets/styles/components/table-responsive.css new file mode 100644 index 0000000..8fe8e9f --- /dev/null +++ b/assets/styles/components/table-responsive.css @@ -0,0 +1,20 @@ +.responsive { + @apply text-sm md:text-base; +} + +.responsive thead { + @apply hidden md:table-header-group; +} + +.responsive tbody tr { + @apply block mb-2 md:table-row; +} + +.responsive td { + @apply grid grid-cols-2 gap-x-2 last:col-span-2 md:table-cell; +} + +.responsive td:before { + content: attr(data-label); + @apply block font-bold last:hidden md:hidden; +} diff --git a/src/Twig/AppExtension.php b/src/Twig/AppExtension.php index d413537..5c3bf83 100644 --- a/src/Twig/AppExtension.php +++ b/src/Twig/AppExtension.php @@ -14,6 +14,7 @@ class AppExtension extends AbstractExtension new TwigFilter('file_size', [AppRuntime::class, 'formatBytes']), new TwigFilter('file_icon', [AppRuntime::class, 'fileIconFilter'], ['is_safe' => ['html']]), new TwigFilter('format_money', [AppRuntime::class, 'formatMoney']), + new TwigFilter('map_status', [AppRuntime::class, 'mapStatus']), ]; } diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index 3a37f71..ef3d407 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -47,4 +47,15 @@ class AppRuntime implements RuntimeExtensionInterface 'class' => $classes, ]); } + + public function mapStatus(string $status): string + { + return match ($status) { + 'F', 'F/S' => 'Festbuchung', + 'S' => 'Stornierung', + 'O' => 'Option', + 'U' => 'Umbuchung', + default => '', + }; + } } diff --git a/templates/booking/index.html.twig b/templates/booking/index.html.twig index f8dbc39..56057e4 100644 --- a/templates/booking/index.html.twig +++ b/templates/booking/index.html.twig @@ -4,49 +4,64 @@

Meine Buchungen

-
+ + + + + + + + + + + + + {% for booking in bookings %} -
-
-
- {% if booking.travelData %} - {{ booking.travel }}, {{ booking.travelData.dateFrom | date('d.m.Y') }} - {{ booking.travelData.dateTo | date('d.m.Y') }} - {% else %} - {{ booking.travel }}, {{ booking.travelDate | date('d.m.Y') }} - {% endif %} -
- - - -
-
-
-
-
- Buchungsdatum -
- {{ booking.bookingDate | date('d.m.Y') }} -
-
-
- Buchungsnummer -
- {{ booking.bookingNumber }} -
-
-
- Reisepreis -
- {{ booking.price|format_currency('EUR') }}/
{{ booking.balance ? booking.balance|format_currency('EUR') : '-' }} -
-
-
- Status -
- {{ booking.status }} -
-
-
+
+ + + + + + + + {% endfor %} - + +
+ Reise + + Buchungsdatum + + Buchungsnummer + + Reisepreis + + offen + + Status + +
+ {% if booking.travelData %} + {{ booking.travel }}, {{ booking.travelData.dateFrom | date('d.m.Y') }} - {{ booking.travelData.dateTo | date('d.m.Y') }} + {% else %} + {{ booking.travel }}, {{ booking.travelDate | date('d.m.Y') }} + {% endif %} + + {{ booking.bookingDate | date('d.m.Y') }} + + {{ booking.bookingNumber }} + + {{ booking.price|format_currency('EUR') }} + + {{ booking.balance ? booking.balance|format_currency('EUR') : '-' }} + + {{ booking.status|map_status }} + +
{% if booking.editable %} @@ -64,12 +79,9 @@ Reisedokumente
- - - {% else %} -
- Keine Daten -
+
{% endblock %} \ No newline at end of file diff --git a/templates/layout.html.twig b/templates/layout.html.twig index 6b623e6..4781d75 100644 --- a/templates/layout.html.twig +++ b/templates/layout.html.twig @@ -1,15 +1,13 @@ -
-
+
{% if is_granted('ROLE_USER') %} -