diff --git a/src/config.rs b/src/config.rs index 1d96e71..5121258 100644 --- a/src/config.rs +++ b/src/config.rs @@ -57,6 +57,7 @@ pub struct Strings { #[derive(Deserialize)] pub struct Config { + pub lang: String, pub path_prefix: String, pub socket_address: SocketAddress, pub email_server: EmailServer, diff --git a/src/routes.rs b/src/routes.rs index 20ba812..f9d150a 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -46,7 +46,10 @@ pub async fn render_contact_form(params: IndexParams<'_>) -> Result) -> Result { + pub lang: &'a str, + pub path_prefix: &'a str, +} + #[derive(Template)] #[template(path = "contact_form.askama.html")] pub struct ContactForm<'a> { - pub path_prefix: &'a str, + pub base: Base<'a>, pub was_validated: bool, pub id: u16, pub name: String, @@ -20,6 +25,6 @@ pub struct ContactForm<'a> { #[derive(Template)] #[template(path = "success.askama.html")] pub struct Success<'a> { - pub path_prefix: &'a str, + pub base: Base<'a>, pub message: &'a str, } diff --git a/templates/base.askama.html b/templates/base.askama.html index dbda384..b0d62e5 100644 --- a/templates/base.askama.html +++ b/templates/base.askama.html @@ -1,5 +1,5 @@ - + @@ -8,7 +8,7 @@ {% block styles %}{% endblock %} - @@ -16,6 +16,6 @@ {% block scripts %}{% endblock %} - + diff --git a/templates/contact_form.askama.html b/templates/contact_form.askama.html index 4654db0..cf51617 100644 --- a/templates/contact_form.askama.html +++ b/templates/contact_form.askama.html @@ -6,7 +6,7 @@

{{ strings.title }}

@@ -42,7 +42,12 @@
- +
{{ strings.message_field.invalid_feedback }}