diff --git a/src/model/planned_event.rs b/src/model/planned_event.rs index ec8c04d..422f14f 100644 --- a/src/model/planned_event.rs +++ b/src/model/planned_event.rs @@ -246,16 +246,16 @@ INNER JOIN trip_details ON planned_event.trip_details_id = trip_details.id", let coxes = Registration::all_cox(db, self.id).await; for user in coxes { if let Some(user) = User::find_by_name(db, &user.name).await { - let notes = match update.notes { - Some(n) if !n.is_empty() => n, - _ => ".", + let notes = if let Some(notes) = update.notes { + format!("Grund der Absage: {notes}") + } else { + String::from("") }; - Notification::create( db, &user, &format!( - "Die Ausfahrt {} am {} um {} wurde abgesagt{}", + "Die Ausfahrt {} am {} um {} wurde abgesagt. {}", self.name, self.day, self.planned_starting_time, notes ), "Absage Ausfahrt", diff --git a/src/model/trip.rs b/src/model/trip.rs index 2c04b0c..9493d3f 100644 --- a/src/model/trip.rs +++ b/src/model/trip.rs @@ -223,16 +223,17 @@ WHERE day=? .rower; for user in rowers { if let Some(user) = User::find_by_name(db, &user.name).await { - let notes = match update.notes { - Some(n) if !n.is_empty() => n, - _ => ".", + let notes = if let Some(notes) = update.notes { + format!("Grund der Absage: {notes}") + } else { + String::from("") }; Notification::create( db, &user, &format!( - "Die Ausfahrt von {} am {} um {} wurde abgesagt{}", + "Die Ausfahrt von {} am {} um {} wurde abgesagt. {}", update.cox.user.name, update.trip.day, update.trip.planned_starting_time, diff --git a/templates/planned.html.tera b/templates/planned.html.tera index e8ae532..d757865 100644 --- a/templates/planned.html.tera +++ b/templates/planned.html.tera @@ -216,7 +216,7 @@ {{ macros::input(label='Titel', name='name', type='input', value=planned_event.name) }} - {{ 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='1') }} {{ 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', id=planned_event.id,checked=planned_event.always_show) }} {{ macros::checkbox(label='Gesperrt', name='is_locked', id=planned_event.id,checked=planned_event.is_locked) }} @@ -243,11 +243,11 @@