From 53afb4ee6f2f7f00fb85431667b569d3dd5982b6 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 2 Apr 2024 20:59:09 +0200 Subject: [PATCH] [TASK] style boat reservation --- frontend/main.ts | 3 +- templates/boatreservations.html.tera | 31 +++++++++++++----- templates/includes/forms/log.html.tera | 22 +++++++++---- templates/includes/macros.html.tera | 37 ++++++++++++++-------- templates/kiosk.html.tera | 34 +++++++++++--------- templates/log.html.tera | 44 ++++++++++++++------------ 6 files changed, 106 insertions(+), 65 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index a04b37c..876f650 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -139,9 +139,8 @@ function selectBoatChange() { const event = e as ChoiceBoatEvent; boat_reserved_today = event.detail.customProperties.boat_reserved_today; - console.log(event.detail.customProperties); if (boat_reserved_today){ - alert(event.detail.label+' wurde heute reserviert. Bitte kontrolliere, dass du die Reservierung nicht störst.'); + alert(event.detail.label.trim()+' wurde heute reserviert. Bitte kontrolliere, dass du die Reservierung nicht störst.'); } boat_in_ottensheim = event.detail.customProperties.boat_in_ottensheim; diff --git a/templates/boatreservations.html.tera b/templates/boatreservations.html.tera index 74436d5..6ddb6cd 100644 --- a/templates/boatreservations.html.tera +++ b/templates/boatreservations.html.tera @@ -42,22 +42,37 @@
{% for reservation in boatreservations %}
- Boot: {{ reservation.boat.name }} + Boot: + {{ reservation.boat.name }}
- Datum: {{ reservation.start_date }} - {% if reservation.end_date != reservation.start_date %}- {{ reservation.end_date }}{% endif %} + Reservierung: + {{ reservation.user_applicant.name }}
- Uhrzeit: {{ reservation.time_desc }} + Datum: + {{ reservation.start_date }} + {% if reservation.end_date != reservation.start_date %} + - + {{ reservation.end_date }} + {% endif %}
- Zweck: {{ reservation.usage }} + Uhrzeit: + {{ reservation.time_desc }}
- Reserviert von {{ reservation.user_applicant.name }} + Zweck: + {{ reservation.usage }} {% if loggedin_user %} {% if loggedin_user.id == reservation.user_applicant.id or "admin" in loggedin_user.roles %} - RESERVIERUNG LÖSCHEN + {% endif %} {% endif %}
diff --git a/templates/includes/forms/log.html.tera b/templates/includes/forms/log.html.tera index 1f29201..8c04c08 100644 --- a/templates/includes/forms/log.html.tera +++ b/templates/includes/forms/log.html.tera @@ -104,6 +104,7 @@ {{ log.departure | date(format="%H:%M") }} Uhr + ({{ log.departure | date(format="%d.%m.%Y") }}) 0 %} - Gäste (ohne Account): + Gäste + (ohne Account): {{ amount_guests }} {% endif %} {% if allowed_to_close and state == "on_water" %} @@ -182,18 +184,23 @@
{% endif %}
- {{ log.boat.name }} ({{ log.shipmaster_user.name -}} + {{ log.boat.name }} + ({{ log.shipmaster_user.name -}} {% if log.shipmaster_only_steering %} - handgesteuert {% endif -%} ) {% if state == "completed" and log.departure | date(format='%d.%m.%Y') == log.arrival | date(format='%d.%m.%Y') %} - {{ log.departure | date(format='%d.%m.%Y') }} ({{ log.departure | date(format='%H:%M') }} - {{ log.arrival | date(format='%H:%M') }}) + {{ log.departure | date(format='%d.%m.%Y') }} + ({{ log.departure | date(format='%H:%M') }} + - + {{ log.arrival | date(format='%H:%M') }}) {% else %} {{ log.departure | date(format='%d.%m.%Y (%H:%M)') }} {% if state == "completed" %} - - {{ log.arrival | date(format='%d.%m.%Y (%H:%M)') }} + - + {{ log.arrival | date(format='%d.%m.%Y (%H:%M)') }} {% endif %} {% endif %} @@ -205,7 +212,8 @@
{{ log.destination }} {% if state == "completed" %} - ({{ log.distance_in_km }} km) + ({{ log.distance_in_km }} + km) {% endif %} {% if log.comments %}- "{{ log.comments }}"{% endif %}
@@ -217,7 +225,9 @@ {% if not loop.last or amount_guests > 0 and log.boat.name != 'Externes Boot' %},{% endif %} {% endfor %} {% if amount_guests > 0 and log.boat.name != 'Externes Boot' %} - Gäste (ohne Account): {{ amount_guests }} + Gäste + (ohne Account): + {{ amount_guests }} {% endif %}
{% endif %} diff --git a/templates/includes/macros.html.tera b/templates/includes/macros.html.tera index db89100..ab69fdc 100644 --- a/templates/includes/macros.html.tera +++ b/templates/includes/macros.html.tera @@ -1,18 +1,25 @@ {% macro boatreservation() %} {% if reservations %} -
{% endif %} @@ -146,7 +155,7 @@ {% if required %}required="required"{% endif %}> {% if default %}{% endif %} {% for d in data %} -