Merge pull request 'show info, if scheckbuch is not yet paid' (#498) from show-scheckbuch-info into staging
Reviewed-on: #498
This commit is contained in:
commit
20cc085562
@ -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 {
|
||||
|
@ -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())
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,11 @@
|
||||
<div class="bg-white dark:bg-primary-900 text-black dark:text-white rounded-md block shadow mt-5"
|
||||
role="alert">
|
||||
<h2 class="h2">Scheckbuch</h2>
|
||||
{% if "paid" not in loggedin_user.roles %}
|
||||
<div class="bg-gray-300 text-center text-black">
|
||||
Bitte nimm zur nächsten Ausfahrt die {{ costs_scheckbuch / 100 }} € für das Scheckbuch mit. Falls du das bereits gemacht hast, gibt uns bitte kurz Bescheid, dass dies noch nicht eingetragen wurde.
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="text-sm p-3">
|
||||
<h3>Du hast bisher {{ last_trips | length }} deiner 5 Scheckbuch-Ausfahrten gemacht:</h3>
|
||||
<ol>
|
||||
@ -100,8 +105,8 @@
|
||||
</small>
|
||||
</h2>
|
||||
{% if day.weather %}
|
||||
<div class="bg-gray-300 rounded text-center">
|
||||
Max temp: {{ day.weather.max_temp | round }}° • Windböe: {{ day.weather.wind_gust | round }} km/h • Regen: {{ day.weather.rain_mm | round }} mm
|
||||
<div class="bg-gray-300 text-center">
|
||||
Max temp: {{ day.weather.max_temp | round }}° • Windböe: {{ day.weather.wind_gust | round }} km/h • Regen: {{ day.weather.rain_mm | round }} mm
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if day.planned_events | length > 0 or day.trips | length > 0 %}
|
||||
|
Loading…
Reference in New Issue
Block a user