mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-29 15:01:10 +00:00
Show 6 articles on the home and on profiles
This commit is contained in:
parent
e403099f47
commit
7a3215edaa
2 changed files with 3 additions and 3 deletions
|
@ -15,7 +15,7 @@ use models::{
|
||||||
fn index(conn: DbConn, user: Option<User>) -> Template {
|
fn index(conn: DbConn, user: Option<User>) -> Template {
|
||||||
match Instance::get_local(&*conn) {
|
match Instance::get_local(&*conn) {
|
||||||
Some(inst) => {
|
Some(inst) => {
|
||||||
let recents = Post::get_recents(&*conn, 5);
|
let recents = Post::get_recents(&*conn, 6);
|
||||||
|
|
||||||
Template::render("instance/index", json!({
|
Template::render("instance/index", json!({
|
||||||
"instance": inst,
|
"instance": inst,
|
||||||
|
|
|
@ -34,8 +34,8 @@ fn me(user: Option<User>) -> Result<Redirect,Flash<Redirect>> {
|
||||||
#[get("/@/<name>", rank = 2)]
|
#[get("/@/<name>", rank = 2)]
|
||||||
fn details(name: String, conn: DbConn, account: Option<User>) -> Template {
|
fn details(name: String, conn: DbConn, account: Option<User>) -> Template {
|
||||||
let user = User::find_by_fqn(&*conn, name).unwrap();
|
let user = User::find_by_fqn(&*conn, name).unwrap();
|
||||||
let recents = Post::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, 5);
|
let reshares = Reshare::get_recents_for_author(&*conn, &user, 6);
|
||||||
let user_id = user.id.clone();
|
let user_id = user.id.clone();
|
||||||
let n_followers = user.get_followers(&*conn).len();
|
let n_followers = user.get_followers(&*conn).len();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue