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
@@ -14,8 +14,11 @@ use models::users::User;
use utils;
#[get("/~/<name>", rank = 2)]
fn details(name: String) -> String {
format!("Welcome on ~{}", name)
fn details(name: String, conn: DbConn) -> Template {
let blog = Blog::find_by_actor_id(&*conn, name).unwrap();
Template::render("blogs/details", json!({
"blog": blog
}))
}
#[get("/~/<name>", format = "application/activity+json", rank = 1)]