Add actual templates for everything

This commit is contained in:
Bat
2018-05-09 20:09:52 +01:00
parent ae60d5961c
commit 292f4d6b27
12 changed files with 77 additions and 12 deletions
+5 -2
View File
@@ -16,10 +16,13 @@ use models::users::User;
use utils;
#[get("/~/<blog>/<slug>", rank = 4)]
fn details(blog: String, slug: String, conn: DbConn) -> String {
fn details(blog: String, slug: String, conn: DbConn) -> Template {
let blog = Blog::find_by_actor_id(&*conn, blog).unwrap();
let post = Post::find_by_slug(&*conn, slug).unwrap();
format!("{} in {}", post.title, blog.title)
Template::render("posts/details", json!({
"post": post,
"blog": blog
}))
}
#[get("/~/<_blog>/<slug>", rank = 3, format = "application/activity+json")]