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..4cf2f66 --- /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..0f6841f 100644 --- a/templates/includes/footer.html.tera +++ b/templates/includes/footer.html.tera @@ -6,6 +6,7 @@ style="text-decoration:underline">... und dir?