@use plume_models::posts::Post; @use plume_models::timeline::Timeline; @use template_utils::*; @use templates::base; @use templates::partials::post_card; @use routes::*; @(ctx: BaseContext, tl: Timeline, articles: Vec, all_tl: Vec, page: i32, n_pages: i32) @:base(ctx, tl.name.clone(), {}, {}, {

@i18n_timeline_name(ctx.1, &tl.name)

@if ctx.clone().2.map(|u| (u.is_admin() && tl.user_id.is_none()) || Some(u.id) == tl.user_id).unwrap_or(false) { @i18n!(ctx.1, "Edit") }
@tabs(&vec![(format!("{}", uri!(instance::index)), i18n!(ctx.1, "Latest articles"), false)] .into_iter().chain(all_tl .into_iter() .map(|t| { let url = format!("{}", uri!(timelines::details: id = t.id, page = _)); (url, i18n_timeline_name(ctx.1, &t.name), t.id == tl.id) }) ).collect::>() ) @if !articles.is_empty() {
@for article in articles { @:post_card(ctx, article) }
} else {

@i18n!(ctx.1, "Nothing to see here yet.")

} @paginate(ctx.1, page, n_pages) })