De-duplicate some parts of the users templates

This commit is contained in:
Bat
2018-06-17 18:48:22 +01:00
parent aa0ce32ec1
commit 0b9515645c
4 changed files with 36 additions and 57 deletions
+2 -1
View File
@@ -129,7 +129,8 @@ fn followers(name: String, conn: DbConn, account: Option<User>) -> Template {
json
}).collect::<Vec<serde_json::Value>>(),
"account": account,
"is_self": account.map(|a| a.id == user_id).unwrap_or(false)
"is_self": account.map(|a| a.id == user_id).unwrap_or(false),
"n_followers": user.get_followers(&*conn).len()
}))
}