show second button in winter
This commit is contained in:
@ -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<SqlitePool>, user: User, flash: Option<FlashMessage<'_
|
||||
context.insert("last_trips", &last_trips);
|
||||
}
|
||||
|
||||
let date = chrono::Utc::now();
|
||||
if date.month() <= 3 || date.month() >= 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);
|
||||
|
Reference in New Issue
Block a user