week: Create new weeks and change active one

Implement a way for admins to introduce new weeks and set them as the last active one.
The last active week is the last one that is accessible to players, and will also prevent
the graph from being displayed.

Implement arrows for navigating between the weeks in the HTML.
This commit is contained in:
trotFunky 2024-07-26 00:50:38 +01:00
parent 635716c04b
commit e08a46af3a
5 changed files with 153 additions and 4 deletions

View file

@ -42,7 +42,11 @@ async fn index(mut db: Connection<Db>) -> Redirect {
fn rocket() -> _ {
rocket::build()
.mount("/", FileServer::from(relative!("static_files")))
.mount("/", routes![index, vote::fetch_vote_data, vote::vote, truth::create_truth, truth::edit_truth, week::week, week::update_week, auth::login])
.mount("/", routes![index,
vote::fetch_vote_data, vote::vote,
truth::create_truth, truth::edit_truth,
week::week, week::update_week, week::set_last_week, week::create_week,
auth::login])
.attach(database::stage())
.attach(Template::fairing())
}