From ca5a932ae54058a70d325fd446e98a6adcdb00b3 Mon Sep 17 00:00:00 2001 From: philipp Date: Thu, 16 May 2024 21:28:36 +0200 Subject: [PATCH] show info, if scheckbuch is not yet paid --- src/model/user.rs | 2 +- src/tera/planned.rs | 3 ++- templates/planned.html.tera | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/model/user.rs b/src/model/user.rs index fff0003..d495cc2 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -28,7 +28,7 @@ const STUDENT_OR_PUPIL: i32 = 8000; const REGULAR: i32 = 22000; const UNTERSTUETZEND: i32 = 2500; const FOERDERND: i32 = 8500; -const SCHECKBUCH: i32 = 3000; +pub const SCHECKBUCH: i32 = 3000; #[derive(FromRow, Serialize, Deserialize, Clone, Debug, Eq, Hash, PartialEq)] pub struct User { diff --git a/src/tera/planned.rs b/src/tera/planned.rs index b438f66..5e5c7e3 100644 --- a/src/tera/planned.rs +++ b/src/tera/planned.rs @@ -13,7 +13,7 @@ use crate::model::{ logbook::Logbook, tripdetails::TripDetails, triptype::TripType, - user::{AllowedForPlannedTripsUser, User, UserWithDetails}, + user::{AllowedForPlannedTripsUser, User, UserWithDetails, SCHECKBUCH}, usertrip::{UserTrip, UserTripDeleteError, UserTripError}, }; @@ -46,6 +46,7 @@ async fn index( context.insert("fee", &user.fee(db).await); context.insert("loggedin_user", &UserWithDetails::from_user(user, db).await); context.insert("days", &days); + context.insert("costs_scheckbuch", &SCHECKBUCH); Template::render("planned", context.into_json()) } diff --git a/templates/planned.html.tera b/templates/planned.html.tera index 638b32f..0f4566c 100644 --- a/templates/planned.html.tera +++ b/templates/planned.html.tera @@ -8,6 +8,11 @@