Add a link to user profile in comments
And move back {% if %} inside of {% block %}, so they get interpreted.
This commit is contained in:
+6
-1
@@ -36,7 +36,12 @@ fn details(blog: String, slug: String, conn: DbConn, user: Option<User>) -> Temp
|
||||
json!({
|
||||
"id": c.id,
|
||||
"content": c.content,
|
||||
"author": c.get_author(&*conn)
|
||||
"author": ({
|
||||
let author = &c.get_author(&*conn);
|
||||
let mut json = serde_json::to_value(author).unwrap();
|
||||
json["fqn"] = serde_json::Value::String(author.get_fqn(&*conn));
|
||||
json
|
||||
})
|
||||
})
|
||||
}).collect::<Vec<serde_json::Value>>(),
|
||||
"n_likes": post.get_likes(&*conn).len(),
|
||||
|
||||
Reference in New Issue
Block a user