From f8016068995c8489dd2a12292ab4aa37adc721a4 Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 19 Oct 2024 22:16:28 +0200 Subject: [PATCH] show second button in winter --- src/tera/mod.rs | 7 ++++++- templates/index.html.tera | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/tera/mod.rs b/src/tera/mod.rs index 314483b..c44652b 100644 --- a/src/tera/mod.rs +++ b/src/tera/mod.rs @@ -1,6 +1,6 @@ use std::{fs::OpenOptions, io::Write}; -use chrono::Local; +use chrono::{Datelike, Local}; use rocket::{ catch, catchers, fairing::{AdHoc, Fairing, Info, Kind}, @@ -63,6 +63,11 @@ async fn index(db: &State, user: User, flash: Option= 10 { + context.insert("show_quick_ergo_button", "yes"); + } + context.insert("achievements", &Achievements::for_user(db, &user).await); context.insert("notifications", &Notification::for_user(db, &user).await); context.insert("loggedin_user", &UserWithDetails::from_user(user, db).await); diff --git a/templates/index.html.tera b/templates/index.html.tera index 698dcc9..1ee0e38 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -12,6 +12,15 @@ Geplante Ausfahrten + {% if show_quick_ergo_button %} + + {% endif %} {% if notifications %}