contact-form/src/templates.rs

31 lines
619 B
Rust
Raw Normal View History

2022-11-01 19:45:06 +00:00
use askama::Template;
2022-10-29 15:12:43 +00:00
2022-12-03 16:08:23 +00:00
use crate::config;
2022-12-17 17:37:04 +00:00
pub struct Base<'a> {
pub lang: &'a str,
pub path_prefix: &'a str,
}
2022-11-01 19:45:06 +00:00
#[derive(Template)]
#[template(path = "contact_form.askama.html")]
2022-10-31 01:13:42 +00:00
pub struct ContactForm<'a> {
2022-12-17 17:37:04 +00:00
pub base: Base<'a>,
2022-10-29 15:12:43 +00:00
pub was_validated: bool,
pub id: u16,
2022-12-03 16:08:23 +00:00
pub name: String,
pub email: String,
pub telefon: String,
pub message: String,
pub captcha: String,
pub error_message: &'a str,
pub strings: &'a config::Strings,
2022-10-29 15:12:43 +00:00
}
2022-11-01 19:45:06 +00:00
#[derive(Template)]
#[template(path = "success.askama.html")]
pub struct Success<'a> {
2022-12-17 17:37:04 +00:00
pub base: Base<'a>,
2022-11-01 19:45:06 +00:00
pub message: &'a str,
}