templates: Make the index a class

The index is a full HTML page with some boilerplate that would be needed in all
pages deviating from the truth list, specifically the head and general structure.

Make the core structure a base template, rebuild the week index page inheriting
from it.
Change which template is used by the route accordingly.
This commit is contained in:
trotFunky 2024-07-27 23:16:19 +01:00
parent afdac98dea
commit b1f37a4e4a
5 changed files with 159 additions and 145 deletions

View file

@ -53,7 +53,7 @@ pub async fn week(week_number: u8, mut db: Connection<Db>, cookies: &CookieJar<'
}
};
Template::render("index", context! {
Template::render("weeks/index", context! {
week_data: week_data,
truths: truths,
user: user,
@ -70,7 +70,7 @@ pub async fn week(week_number: u8, mut db: Connection<Db>, cookies: &CookieJar<'
}
};
Template::render("index", context! {
Template::render("weeks/index", context! {
week_data: week_data,
truths: truths,
user: user,