what2watch/src/templates.rs

42 lines
1.3 KiB
Rust
Raw Normal View History

use askama::Template;
2023-05-28 19:20:55 +00:00
use serde::{Deserialize, Serialize};
2023-06-15 05:05:50 +00:00
use crate::{OptionalOptionalUser, User};
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
2023-05-17 20:40:06 +00:00
#[template(path = "signup.html")]
pub struct SignupPage {
pub username: String,
pub displayname: Option<String>,
pub email: Option<String>,
pub password: String,
pub pw_verify: String,
}
2023-05-28 19:20:55 +00:00
#[derive(
Debug, Clone, Template, Default, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser,
)]
2023-06-03 22:45:19 +00:00
#[template(path = "signup_success.html")]
pub struct SignupSuccessPage(pub User);
2023-06-03 22:45:19 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
2023-06-20 19:14:18 +00:00
#[template(path = "login_page.html")]
pub struct LoginPage {
2023-05-28 19:20:55 +00:00
pub username: String,
pub password: String,
}
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
2023-06-20 19:14:18 +00:00
#[template(path = "logout_page.html")]
pub struct LogoutPage;
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
2023-06-20 19:14:18 +00:00
#[template(path = "logout_success.html")]
pub struct LogoutSuccessPage;
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq, OptionalOptionalUser)]
#[template(path = "index.html")]
pub struct MainPage {
pub user: Option<User>,
}