Plume/templates/users/followers.rs.html
Baptiste Gelez 7645fdbf35
Fix tabs on user page (#516)
The "Articles" tab was always selected.
2019-04-06 19:03:00 +01:00

27 lines
1.1 KiB
HTML

@use templates::{base, users::header};
@use template_utils::*;
@use plume_models::users::User;
@use routes::*;
@(ctx: BaseContext, user: User, follows: bool, is_remote: bool, remote_url: String, followers: Vec<User>, page: i32, n_pages: i32)
@:base(ctx, i18n!(ctx.1, "{0}'s subscribers"; user.name()), {}, {}, {
@:header(ctx, &user, follows, is_remote, remote_url)
@tabs(&[
(&uri!(user::details: name = &user.fqn).to_string(), i18n!(ctx.1, "Articles"), false),
(&uri!(user::followers: name = &user.fqn, page = _).to_string(), i18n!(ctx.1, "Subscribers"), true),
(&uri!(user::followed: name = &user.fqn, page = _).to_string(), i18n!(ctx.1, "Subscriptions"), false)
])
<div class="cards">
@for follower in followers {
<div class="card">
<h3><a href="@uri!(user::details: name = &follower.fqn)">@follower.name()</a> <small>@format!("@{}", &follower.fqn)</small></h3>
<main><p>@Html(follower.summary_html)</p></main>
</div>
}
</div>
@paginate(ctx.1, page, n_pages)
})