Load more button on Posts page
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled

This commit is contained in:
Alphonse Paix
2025-09-23 18:24:12 +02:00
parent 5c5e3b0e4c
commit b1e315921e
7 changed files with 96 additions and 37 deletions

View File

@@ -27,39 +27,47 @@ pub struct DashboardTemplate {
}
#[derive(Template)]
#[template(path = "../templates/home.html")]
#[template(path = "home.html")]
pub struct HomeTemplate;
#[derive(Template)]
#[template(path = "../templates/posts.html")]
#[template(path = "posts.html")]
pub struct PostsTemplate {
pub posts: Vec<PostEntry>,
pub next_page: Option<i64>,
}
#[derive(Template)]
#[template(path = "../templates/post.html")]
#[template(path = "posts.html", block = "posts")]
pub struct PostListTemplate {
pub posts: Vec<PostEntry>,
pub next_page: Option<i64>,
}
#[derive(Template)]
#[template(path = "post.html")]
pub struct PostTemplate {
pub post: PostEntry,
}
#[derive(Template)]
#[template(path = "../templates/confirm.html")]
#[template(path = "confirm.html")]
pub struct ConfirmTemplate;
#[derive(Template)]
#[template(path = "../templates/404.html")]
#[template(path = "404.html")]
pub struct NotFoundTemplate;
#[derive(Template)]
#[template(path = "../templates/unsubscribe_confirm.html")]
#[template(path = "unsubscribe_confirm.html")]
pub struct UnsubscribeConfirmTemplate;
#[derive(Template)]
#[template(path = "../templates/unsubscribe.html")]
#[template(path = "unsubscribe.html")]
pub struct UnsubscribeTemplate;
#[derive(Template)]
#[template(path = "../templates/email/new_post.html")]
#[template(path = "email/new_post.html")]
pub struct NewPostEmailTemplate<'a> {
pub base_url: &'a str,
pub post_title: &'a str,
@@ -68,7 +76,7 @@ pub struct NewPostEmailTemplate<'a> {
}
#[derive(Template)]
#[template(path = "../templates/email/standalone.html")]
#[template(path = "email/standalone.html")]
pub struct StandaloneEmailTemplate<'a> {
pub base_url: &'a str,
pub html_content: &'a str,
@@ -135,9 +143,3 @@ You're receiving this because you subscribed to the zero2prod newsletter."#,
)
}
}
#[derive(Template)]
#[template(path = "../templates/post_card_fragment.html")]
pub struct PostCardTemplate<'a> {
pub post: &'a PostEntry,
}