diff --git a/src/tera/mod.rs b/src/tera/mod.rs index c38206c..36ea1ad 100644 --- a/src/tera/mod.rs +++ b/src/tera/mod.rs @@ -65,6 +65,17 @@ async fn index(db: &State, user: User, flash: Option, user: Option) -> Template { + let mut context = Context::new(); + + if let Some(user) = user { + context.insert("loggedin_user", &UserWithDetails::from_user(user, db).await); + } + + Template::render("impressum", context.into_json()) +} + #[get("/steering")] async fn steering(db: &State, user: User, flash: Option>) -> Template { let mut context = Context::new(); @@ -179,7 +190,7 @@ pub struct Config { pub fn config(rocket: Rocket) -> Rocket { rocket - .mount("/", routes![index, steering]) + .mount("/", routes![index, steering, impressum]) .mount("/auth", auth::routes()) .mount("/wikiauth", routes![wikiauth]) .mount("/log", log::routes()) diff --git a/templates/impressum.html.tera b/templates/impressum.html.tera new file mode 100644 index 0000000..965225f --- /dev/null +++ b/templates/impressum.html.tera @@ -0,0 +1,88 @@ +{% extends "base" %} +{% block content %} +
+

Impressum

+
+ +
+
+ +
+ {% if loggedin_user %} +
+ +
+ {% endif %} +
+ +
+
+{% endblock content %} diff --git a/templates/includes/footer.html.tera b/templates/includes/footer.html.tera index 29cebd1..727e4ac 100644 --- a/templates/includes/footer.html.tera +++ b/templates/includes/footer.html.tera @@ -1,9 +1,9 @@