* Create a minimalistic toast
* Profile editing (WIP)
This commit is contained in:
parent
327b2d0a5b
commit
1c79cc890d
25 changed files with 1133 additions and 575 deletions
70
backend/src/html_templates.rs
Normal file
70
backend/src/html_templates.rs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
use askama::Template;
|
||||
|
||||
use crate::model;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "home.html")]
|
||||
pub struct HomeTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub recipes: Vec<(i64, String)>,
|
||||
pub current_recipe_id: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "view_recipe.html")]
|
||||
pub struct ViewRecipeTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub recipes: Vec<(i64, String)>,
|
||||
pub current_recipe_id: Option<i64>,
|
||||
pub current_recipe: model::Recipe,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "message.html")]
|
||||
pub struct MessageTemplate<'a> {
|
||||
pub user: Option<model::User>,
|
||||
pub message: &'a str,
|
||||
pub as_code: bool, // Display the message in <pre> markup.
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "sign_up_form.html")]
|
||||
pub struct SignUpFormTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub email: String,
|
||||
pub message: String,
|
||||
pub message_email: String,
|
||||
pub message_password: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "sign_in_form.html")]
|
||||
pub struct SignInFormTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub email: String,
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "ask_reset_password.html")]
|
||||
pub struct AskResetPasswordTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub email: String,
|
||||
pub message: String,
|
||||
pub message_email: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "reset_password.html")]
|
||||
pub struct ResetPasswordTemplate {
|
||||
pub user: Option<model::User>,
|
||||
pub reset_token: String,
|
||||
pub message: String,
|
||||
pub message_password: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "profile.html")]
|
||||
pub struct ProfileTemplate {
|
||||
pub user: Option<model::User>,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue