From 21b87f947152e4b6fc9e0c9bdb4282017c13a985 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 4 Apr 2023 15:42:26 +0200 Subject: [PATCH] cox always see full year --- src/rest/mod.rs | 11 +++-------- templates/index.html.tera | 4 ---- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/rest/mod.rs b/src/rest/mod.rs index 163e378..1075400 100644 --- a/src/rest/mod.rs +++ b/src/rest/mod.rs @@ -14,17 +14,12 @@ mod admin; mod auth; mod cox; -#[get("/?")] -async fn index( - db: &State, - user: User, - flash: Option>, - all: Option, -) -> Template { +#[get("/")] +async fn index(db: &State, user: User, flash: Option>) -> Template { let mut days = Vec::new(); let mut show_next_n_days = 6; - if all.is_some() && user.is_cox { + if user.is_cox { let end_of_year = NaiveDate::from_ymd_opt(Local::now().year(), 12, 31).unwrap(); show_next_n_days = end_of_year .signed_duration_since(Local::now().date_naive()) diff --git a/templates/index.html.tera b/templates/index.html.tera index e28d1ef..6007001 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -2,10 +2,6 @@ {% block content %} -{% if loggedin_user.is_cox %} - SHOW FULL YEAR -{% endif %} - {% if loggedin_user %} Hi {{ loggedin_user.name }}. LOGOUT