diff --git a/frontend/scss/components/_sidebar.scss b/frontend/scss/components/_sidebar.scss index 716f51c..a9c12f3 100644 --- a/frontend/scss/components/_sidebar.scss +++ b/frontend/scss/components/_sidebar.scss @@ -18,11 +18,6 @@ width: 100%; max-width: 375px; z-index: 40000; - - /* safari bugfix */ - .sidebar-header { - right: 0px; - } } &.slide-in { @@ -66,6 +61,7 @@ &-close { border-radius: 100%; + flex: 0 0 auto; @apply w-6 h-6; } @@ -75,14 +71,6 @@ width: 374px; bottom: 0; } - - &-header { - position: fixed; - width: 100%; - max-width: 375px; - top: 0px; - z-index: 1; - } } .overlay { diff --git a/src/model/planned_event.rs b/src/model/planned_event.rs index 0bfd7ea..0180bc2 100644 --- a/src/model/planned_event.rs +++ b/src/model/planned_event.rs @@ -211,10 +211,12 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM planned_even planned_amount_cox: i32, max_people: i32, notes: Option<&str>, + always_show: bool, ) { sqlx::query!( - "UPDATE planned_event SET planned_amount_cox = ? WHERE id = ?", + "UPDATE planned_event SET planned_amount_cox = ?, always_show=? WHERE id = ?", planned_amount_cox, + always_show, self.id ) .execute(db) diff --git a/src/rest/admin/planned_event.rs b/src/rest/admin/planned_event.rs index 40837fb..c1bba28 100644 --- a/src/rest/admin/planned_event.rs +++ b/src/rest/admin/planned_event.rs @@ -62,6 +62,7 @@ struct UpdatePlannedEventForm<'r> { planned_amount_cox: i32, max_people: i32, notes: Option<&'r str>, + always_show: bool, } #[put("/planned-event", data = "")] @@ -73,7 +74,13 @@ async fn update( match PlannedEvent::find_by_id(db, data.id).await { Some(planned_event) => { planned_event - .update(db, data.planned_amount_cox, data.max_people, data.notes) + .update( + db, + data.planned_amount_cox, + data.max_people, + data.notes, + data.always_show, + ) .await; Flash::success(Redirect::to("/"), "Successfully edited the event") } diff --git a/templates/dynamics/sidebar.html.tera b/templates/dynamics/sidebar.html.tera index ce2341a..1720f1b 100644 --- a/templates/dynamics/sidebar.html.tera +++ b/templates/dynamics/sidebar.html.tera @@ -10,7 +10,7 @@ {% include "includes/plus-icon" %} -
+
Formular wird ersetzt
diff --git a/templates/index.html.tera b/templates/index.html.tera index bb0a145..f6f4250 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -22,23 +22,23 @@ {% endif %} {% endfor %} {% endif %} -
+
-

{{ day.day| date(format="%d.%m.%Y") }} +

{{ day.day| date(format="%d.%m.%Y") }} {{ day.day | date(format="%A", locale="de_AT") }}

{% if day.planned_events | length > 0 or day.trips | length > 0 %} -
+
{# --- START Events --- #} {% if day.planned_events | length > 0 %} {% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %} {% set amount_cur_cox = planned_event.cox | length %} {% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %} -
+
-
+
{{ planned_event.planned_starting_time }} Uhr {% if planned_event.trip_type %} @@ -126,10 +126,11 @@

Ausfahrt bearbeiten

- - + + {{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }} - {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }} + {{ macros::input(label='Anzahl Steuerleute', name='planned_amount_cox', type='number', value=planned_event.planned_amount_cox, required=true, min='0') }} + {{ macros::checkbox(label='Immer anzeigen', name='always_show') }} {{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }} @@ -156,10 +157,10 @@ {# --- START Trips --- #} {% if day.trips | length > 0 %} - {% for trip in day.trips %} -
+ {% for trip in day.trips | sort(attribute="planned_starting_time") %} +
-
+
{% if trip.max_people == 0 %} ⚠ {{ trip.planned_starting_time }} Uhr {% if trip.trip_type %} @@ -201,10 +202,8 @@ {% endif %}
-
- - {# --- START Sidebar Content --- #} -