feat: customization for imprint

This commit is contained in:
Max Hohlfeld 2025-06-09 13:55:24 +02:00
parent fe2f616bea
commit bce103b086
2 changed files with 14 additions and 8 deletions

View File

@ -1,15 +1,21 @@
use actix_web::Responder;
use actix_web::{web, Responder};
use askama::Template;
use crate::utils::{ApplicationError, TemplateResponse};
use crate::utils::{ApplicationError, Customization, TemplateResponse};
#[derive(Template)]
#[template(path = "imprint.html")]
struct ImprintTemplate {}
struct ImprintTemplate {
webmaster_mail: String,
}
#[actix_web::get("/imprint")]
pub async fn get_imprint() -> Result<impl Responder, ApplicationError> {
let template = ImprintTemplate {};
pub async fn get_imprint(
customization: web::Data<Customization>,
) -> Result<impl Responder, ApplicationError> {
let template = ImprintTemplate {
webmaster_mail: customization.webmaster_email.clone(),
};
Ok(template.to_response()?)
}

View File

@ -18,13 +18,13 @@
</p>
<p>
E-Mail: max.hohlfeld@brasiwa-leipzig.de
E-Mail: {{ webmaster_mail }}
</p>
<h1>Datenschutzerklärung</h1>
<h3>Name und Kontaktdaten des Verantwortlichen</h3>
<p> Kamerad Max Hohlfeld </p>
<p> E-Mail: max.hohlfeld@brasiwa-leipzig.de </p>
<p>Kamerad Max Hohlfeld</p>
<p>E-Mail: {{ webmaster_mail }}</p>
<h3>Erhobene Daten</h3>
<p>