Templates refactoring
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use askama::Template;
|
||||
|
||||
use crate::domain::PostEntry;
|
||||
|
||||
#[derive(Template)]
|
||||
pub enum MessageTemplate {
|
||||
#[template(path = "../templates/success.html")]
|
||||
@@ -11,3 +13,39 @@ pub enum MessageTemplate {
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/500.html")]
|
||||
pub struct InternalErrorTemplate;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/login.html")]
|
||||
pub struct LoginTemplate;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/dashboard.html")]
|
||||
pub struct DashboardTemplate {
|
||||
pub username: String,
|
||||
pub idempotency_key_1: String,
|
||||
pub idempotency_key_2: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/home.html")]
|
||||
pub struct HomeTemplate;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/posts.html")]
|
||||
pub struct PostsTemplate {
|
||||
pub posts: Vec<PostEntry>,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/post.html")]
|
||||
pub struct PostTemplate {
|
||||
pub post: PostEntry,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/confirm.html")]
|
||||
pub struct ConfirmTemplate;
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "../templates/404.html")]
|
||||
pub struct NotFoundTemplate;
|
||||
|
||||
Reference in New Issue
Block a user