Show 6 articles on the home and on profiles

This commit is contained in:
Bat 2018-06-10 17:37:02 +01:00
parent e403099f47
commit 7a3215edaa
2 changed files with 3 additions and 3 deletions

View File

@ -15,7 +15,7 @@ use models::{
fn index(conn: DbConn, user: Option<User>) -> Template {
match Instance::get_local(&*conn) {
Some(inst) => {
let recents = Post::get_recents(&*conn, 5);
let recents = Post::get_recents(&*conn, 6);
Template::render("instance/index", json!({
"instance": inst,

View File

@ -34,8 +34,8 @@ fn me(user: Option<User>) -> Result<Redirect,Flash<Redirect>> {
#[get("/@/<name>", rank = 2)]
fn details(name: String, conn: DbConn, account: Option<User>) -> Template {
let user = User::find_by_fqn(&*conn, name).unwrap();
let recents = Post::get_recents_for_author(&*conn, &user, 5);
let reshares = Reshare::get_recents_for_author(&*conn, &user, 5);
let recents = Post::get_recents_for_author(&*conn, &user, 6);
let reshares = Reshare::get_recents_for_author(&*conn, &user, 6);
let user_id = user.id.clone();
let n_followers = user.get_followers(&*conn).len();