Merge branch 'main' of gitlab.com:PhilippHofer/rot
This commit is contained in:
commit
5c2eabd338
@ -18,11 +18,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 375px;
|
max-width: 375px;
|
||||||
z-index: 40000;
|
z-index: 40000;
|
||||||
|
|
||||||
/* safari bugfix */
|
|
||||||
.sidebar-header {
|
|
||||||
right: 0px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.slide-in {
|
&.slide-in {
|
||||||
@ -66,6 +61,7 @@
|
|||||||
|
|
||||||
&-close {
|
&-close {
|
||||||
border-radius: 100%;
|
border-radius: 100%;
|
||||||
|
flex: 0 0 auto;
|
||||||
@apply w-6 h-6;
|
@apply w-6 h-6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,14 +71,6 @@
|
|||||||
width: 374px;
|
width: 374px;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&-header {
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 375px;
|
|
||||||
top: 0px;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.overlay {
|
.overlay {
|
||||||
|
@ -211,10 +211,12 @@ FROM user_trip WHERE trip_details_id = (SELECT trip_details_id FROM planned_even
|
|||||||
planned_amount_cox: i32,
|
planned_amount_cox: i32,
|
||||||
max_people: i32,
|
max_people: i32,
|
||||||
notes: Option<&str>,
|
notes: Option<&str>,
|
||||||
|
always_show: bool,
|
||||||
) {
|
) {
|
||||||
sqlx::query!(
|
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,
|
planned_amount_cox,
|
||||||
|
always_show,
|
||||||
self.id
|
self.id
|
||||||
)
|
)
|
||||||
.execute(db)
|
.execute(db)
|
||||||
|
@ -62,6 +62,7 @@ struct UpdatePlannedEventForm<'r> {
|
|||||||
planned_amount_cox: i32,
|
planned_amount_cox: i32,
|
||||||
max_people: i32,
|
max_people: i32,
|
||||||
notes: Option<&'r str>,
|
notes: Option<&'r str>,
|
||||||
|
always_show: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[put("/planned-event", data = "<data>")]
|
#[put("/planned-event", data = "<data>")]
|
||||||
@ -73,7 +74,13 @@ async fn update(
|
|||||||
match PlannedEvent::find_by_id(db, data.id).await {
|
match PlannedEvent::find_by_id(db, data.id).await {
|
||||||
Some(planned_event) => {
|
Some(planned_event) => {
|
||||||
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;
|
.await;
|
||||||
Flash::success(Redirect::to("/"), "Successfully edited the event")
|
Flash::success(Redirect::to("/"), "Successfully edited the event")
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
{% include "includes/plus-icon" %}
|
{% include "includes/plus-icon" %}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="body-js px-2 pt-2" style="margin-top: 63px; margin-bottom: 157px">
|
<div class="body-js px-2 pt-2">
|
||||||
Formular wird ersetzt
|
Formular wird ersetzt
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,23 +22,23 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="bg-white p-3 rounded-md flex justify-between flex-col shadow reset-js" style="min-height: 10rem;" data-trips="{{ amount_trips }}" data-month="{{ day.day| date(format='%m') }}" data-coxneeded="{{ day_cox_needed }}">
|
<div class="bg-white rounded-md flex justify-between flex-col shadow reset-js" style="min-height: 10rem;" data-trips="{{ amount_trips }}" data-month="{{ day.day| date(format='%m') }}" data-coxneeded="{{ day_cox_needed }}">
|
||||||
<div>
|
<div>
|
||||||
<h2 class="font-bold uppercase tracking-wide text-center text-primary-950 text-lg">{{ day.day| date(format="%d.%m.%Y") }}
|
<h2 class="font-bold uppercase tracking-wide text-center text-primary-950 text-lg px-3 pt-3">{{ day.day| date(format="%d.%m.%Y") }}
|
||||||
<small class="inline-block ml-1 text-xs text-gray-400">{{ day.day | date(format="%A", locale="de_AT") }}</small>
|
<small class="inline-block ml-1 text-xs text-gray-400">{{ day.day | date(format="%A", locale="de_AT") }}</small>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{% if day.planned_events | length > 0 or day.trips | length > 0 %}
|
{% if day.planned_events | length > 0 or day.trips | length > 0 %}
|
||||||
<div class="grid grid-cols-1 gap-3 divide-y mb-3">
|
<div class="grid grid-cols-1 gap-3 my-3">
|
||||||
|
|
||||||
{# --- START Events --- #}
|
{# --- START Events --- #}
|
||||||
{% if day.planned_events | length > 0 %}
|
{% if day.planned_events | length > 0 %}
|
||||||
{% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %}
|
{% for planned_event in day.planned_events | sort(attribute="planned_starting_time") %}
|
||||||
{% set amount_cur_cox = planned_event.cox | length %}
|
{% set amount_cur_cox = planned_event.cox | length %}
|
||||||
{% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %}
|
{% set amount_cox_missing = planned_event.planned_amount_cox - amount_cur_cox %}
|
||||||
<div class="pt-2">
|
<div class="pt-2 px-3 border-t" style="order: {{ planned_event.planned_starting_time | replace(from=":", to="") | trim_start_matches(pat="0") }}">
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div>
|
<div class="mr-1">
|
||||||
<strong class="text-primary-900">
|
<strong class="text-primary-900">
|
||||||
{{ planned_event.planned_starting_time }} Uhr
|
{{ planned_event.planned_starting_time }} Uhr
|
||||||
{% if planned_event.trip_type %}
|
{% if planned_event.trip_type %}
|
||||||
@ -126,10 +126,11 @@
|
|||||||
<div class="bg-gray-100 p-3 mt-4 rounded-md">
|
<div class="bg-gray-100 p-3 mt-4 rounded-md">
|
||||||
<h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
|
<h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
|
||||||
<form action="/admin/planned-event" method="post" class="grid gap-3">
|
<form action="/admin/planned-event" method="post" class="grid gap-3">
|
||||||
<input type="hidden" name="_method" value="put" />
|
<input type="hidden" name="_method" value="put" />
|
||||||
<input type="hidden" name="id" value="{{ planned_event.id }}" />
|
<input type="hidden" name="id" value="{{ planned_event.id }}" />
|
||||||
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=planned_event.max_people, min='0') }}
|
{{ 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) }}
|
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=planned_event.notes) }}
|
||||||
|
|
||||||
<input value="Bearbeiten" class="btn btn-primary" type="submit" />
|
<input value="Bearbeiten" class="btn btn-primary" type="submit" />
|
||||||
@ -156,10 +157,10 @@
|
|||||||
|
|
||||||
{# --- START Trips --- #}
|
{# --- START Trips --- #}
|
||||||
{% if day.trips | length > 0 %}
|
{% if day.trips | length > 0 %}
|
||||||
{% for trip in day.trips %}
|
{% for trip in day.trips | sort(attribute="planned_starting_time") %}
|
||||||
<div class="pt-2 reset-js" data-coxneeded="false">
|
<div class="pt-2 px-3 reset-js border-t" style="order: {{ trip.planned_starting_time | replace(from=":", to="") | trim_start_matches(pat="0") }}" data-coxneeded="false">
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<div>
|
<div class="mr-1">
|
||||||
{% if trip.max_people == 0 %}
|
{% if trip.max_people == 0 %}
|
||||||
<strong class="text-[#f43f5e]">⚠ {{ trip.planned_starting_time }} Uhr
|
<strong class="text-[#f43f5e]">⚠ {{ trip.planned_starting_time }} Uhr
|
||||||
{% if trip.trip_type %}
|
{% if trip.trip_type %}
|
||||||
@ -201,10 +202,8 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{# --- START Sidebar Content --- #}
|
||||||
|
<div class="hidden">
|
||||||
{# --- START Sidebar Content --- #}
|
|
||||||
<div class="hidden">
|
|
||||||
<div id="trip{{ trip.trip_details_id }}">
|
<div id="trip{{ trip.trip_details_id }}">
|
||||||
{% if trip.max_people == 0 %}
|
{% if trip.max_people == 0 %}
|
||||||
{# --- border-[#f43f5e] bg-[#f43f5e] --- #}
|
{# --- border-[#f43f5e] bg-[#f43f5e] --- #}
|
||||||
@ -214,14 +213,14 @@
|
|||||||
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }}
|
{{ macros::box(participants=trip.rower, empty_seats=trip.max_people - amount_cur_rower, bg='primary-100', color='black') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# --- START Edit Form --- #}
|
{# --- START Edit Form --- #}
|
||||||
{% if trip.cox_id == loggedin_user.id %}
|
{% if trip.cox_id == loggedin_user.id %}
|
||||||
<div class="bg-gray-100 p-3 mt-4 rounded-md">
|
<div class="bg-gray-100 p-3 mt-4 rounded-md">
|
||||||
<h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
|
<h3 class="text-primary-950 font-bold uppercase tracking-wide mb-2">Ausfahrt bearbeiten</h3>
|
||||||
<form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3">
|
<form action="/cox/trip/{{ trip.id }}" method="post" class="grid gap-3">
|
||||||
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }}
|
{{ macros::input(label='Anzahl Ruderer', name='max_people', type='number', required=true, value=trip.max_people, min='0') }}
|
||||||
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }}
|
{{ macros::input(label='Anmerkungen', name='notes', type='input', value=trip.notes) }}
|
||||||
{{ macros::select(select_name='trip_type', trip_types=trip_types, default='Reguläre Ausfahrt', selected_id=trip.trip_type_id) }}
|
{{ macros::select(select_name='trip_type', trip_types=trip_types, default='Reguläre Ausfahrt', selected_id=trip.trip_type_id) }}
|
||||||
|
|
||||||
<input value="Bearbeiten" class="btn btn-primary" type="submit" />
|
<input value="Bearbeiten" class="btn btn-primary" type="submit" />
|
||||||
</form>
|
</form>
|
||||||
@ -239,6 +238,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{# --- END Sidebar Content --- #}
|
{# --- END Sidebar Content --- #}
|
||||||
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{# --- END Trips --- #}
|
{# --- END Trips --- #}
|
||||||
@ -248,7 +248,7 @@
|
|||||||
|
|
||||||
{# --- START Add Buttons --- #}
|
{# --- START Add Buttons --- #}
|
||||||
{% if loggedin_user.is_admin or loggedin_user.is_cox %}
|
{% if loggedin_user.is_admin or loggedin_user.is_cox %}
|
||||||
<div class="-mb-3 -mx-3 grid {% if loggedin_user.is_admin %} grid-cols-2 {% endif %} text-center">
|
<div class="grid {% if loggedin_user.is_admin %} grid-cols-2 {% endif %} text-center">
|
||||||
{% if loggedin_user.is_admin %}
|
{% if loggedin_user.is_admin %}
|
||||||
<a href="#" data-sidebar="true" data-trigger="sidebar"
|
<a href="#" data-sidebar="true" data-trigger="sidebar"
|
||||||
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
|
data-header="<strong>Event</strong> am {{ day.day| date(format='%d.%m.%Y') }} erstellen"
|
||||||
|
Loading…
Reference in New Issue
Block a user