blob: 2ce69f84ff3650d58b78fab9a3d7825c333b0dae (
plain) (
tree)
|
|
use crate::helpers::*;
use crate::posts::abstractions::post::Post;
use askama::Template;
#[derive(Template)]
#[template(path = "posts.html")]
pub struct PostsView<P: Post> {
posts: Vec<P>,
}
impl<P: Post> PostsView<P> {
pub fn with_posts(posts: impl IntoIterator<Item = P>) -> Self {
Self {
posts: posts.into_iter().collect(),
}
}
}
|