what2watch/src/templates.rs

43 lines
1.1 KiB
Rust
Raw Normal View History

use askama::Template;
2023-05-28 19:20:55 +00:00
use serde::{Deserialize, Serialize};
use crate::User;
2023-06-02 21:15:13 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq)]
2023-05-17 20:40:06 +00:00
#[template(path = "signup.html")]
pub struct CreateUser {
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
2023-06-02 21:15:13 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq)]
2023-05-28 19:20:55 +00:00
#[template(path = "login_post.html")]
pub struct LoginPost {
pub username: String,
pub password: String,
}
2023-06-02 21:15:13 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq)]
2023-05-28 19:20:55 +00:00
#[template(path = "login_get.html")]
pub struct LoginGet {
pub username: String,
pub password: String,
}
2023-06-02 21:15:13 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq)]
#[template(path = "logout_get.html")]
pub struct LogoutGet;
2023-06-02 21:15:13 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq)]
#[template(path = "logout_post.html")]
pub struct LogoutPost;
2023-06-02 21:15:13 +00:00
#[derive(Debug, Default, Template, Deserialize, Serialize, PartialEq, Eq)]
#[template(path = "index.html")]
pub struct Index {
pub user: Option<User>,
}