diff --git a/migrations/20230609121618_initial.sql b/migrations/20230609121618_initial.sql index 089c0b90..ec3d5b6c 100644 --- a/migrations/20230609121618_initial.sql +++ b/migrations/20230609121618_initial.sql @@ -49,7 +49,8 @@ CREATE TABLE event endTime TIME NOT NULL, name TEXT NOT NULL, locationId INTEGER NOT NULL REFERENCES location (id) ON DELETE CASCADE, - voluntaryWachhabender BOOLEAN NOT NULL, + voluntaryWachhabender BOOLEAN NOT NULL, + voluntaryFuehrungsassistent BOOLEAN NOT NULL, amountOfPosten SMALLINT NOT NULL CHECK (amountOfPosten >= 0), clothing TEXT NOT NULL, note TEXT, diff --git a/src/endpoints/user/get_profile.rs b/src/endpoints/user/get_profile.rs index 2f472d3d..5c1224db 100644 --- a/src/endpoints/user/get_profile.rs +++ b/src/endpoints/user/get_profile.rs @@ -3,17 +3,22 @@ use askama::Template; use askama_actix::TemplateToResponse; use sqlx::PgPool; -use crate::models::{Area, Function, Role, User}; +use crate::{ + filters, + models::{Area, Role, User}, +}; #[derive(Template)] #[template(path = "user/profile.html")] struct ProfileTemplate { - user: User + user: User, } #[actix_web::get("/profile")] pub async fn get(user: web::ReqData, pool: web::Data) -> impl Responder { - let area = Area::read_by_id(pool.get_ref(), user.area_id).await.unwrap(); + let area = Area::read_by_id(pool.get_ref(), user.area_id) + .await + .unwrap(); let mut user = user.into_inner(); user.area = area; diff --git a/templates/events/plan.html b/templates/events/plan.html index 02ab6ff7..bd43245e 100644 --- a/templates/events/plan.html +++ b/templates/events/plan.html @@ -51,13 +51,6 @@
Einteilung Personal
-
- - - - Alle Plätze verplant! -
- {% include "plan_personal_table.html" %}
diff --git a/templates/events/plan_personal_table.html b/templates/events/plan_personal_table.html index 52858e8f..b6bc9720 100644 --- a/templates/events/plan_personal_table.html +++ b/templates/events/plan_personal_table.html @@ -1,3 +1,12 @@ +{% if !further_posten_required && !further_fuehrungsassistent_required && !further_wachhabender_required %} +
+ + + + Alle Plätze verplant! +
+{% endif %} + diff --git a/templates/user/new_or_edit.html b/templates/user/new_or_edit.html index b24b6a89..837914f9 100644 --- a/templates/user/new_or_edit.html +++ b/templates/user/new_or_edit.html @@ -69,6 +69,8 @@
diff --git a/templates/user/profile.html b/templates/user/profile.html index cd86118c..4d382dff 100644 --- a/templates/user/profile.html +++ b/templates/user/profile.html @@ -62,13 +62,7 @@
- {% match user.function %} - {% when Function::Posten %} - Posten - {% when Function::Wachhabender %} - Wachhabender - {% else %} - {% endmatch %} + {{ user.function|show_tree|safe }}