From 4bd91b2a7e19f8c6957cda04f1d71e9db7c9d639 Mon Sep 17 00:00:00 2001 From: philipp Date: Fri, 17 May 2024 12:26:10 +0200 Subject: [PATCH 1/3] add impressum --- src/tera/mod.rs | 13 ++++- templates/impressum.html.tera | 87 +++++++++++++++++++++++++++++ templates/includes/footer.html.tera | 1 + 3 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 templates/impressum.html.tera 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..f0a182f --- /dev/null +++ b/templates/impressum.html.tera @@ -0,0 +1,87 @@ +{% 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?
+ Impressum
-- 2.45.2 From 261753c6b479a1b91e20582ccd93006aeb248cb6 Mon Sep 17 00:00:00 2001 From: philipp Date: Fri, 17 May 2024 12:28:45 +0200 Subject: [PATCH 3/3] reformat --- templates/impressum.html.tera | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/impressum.html.tera b/templates/impressum.html.tera index cbaa6ae..4cf2f66 100644 --- a/templates/impressum.html.tera +++ b/templates/impressum.html.tera @@ -65,7 +65,7 @@
  • Logbucheinträge
  • Selber eingetragene Bootsschäden, solange sie nicht > 1 Monat verifiziert und repariert wurden
  • Selber eingetragene Bootsreservierung
  • -
  • Boote, sofern es welche im Privatbesitz gibt
  • +
  • Boote, sofern es welche im Privatbesitz gibt
  • -- 2.45.2