2019-10-07 19:08:20 +02:00
|
|
|
@use plume_models::posts::Post;
|
|
|
|
@use plume_models::timeline::Timeline;
|
2020-01-21 07:02:03 +01:00
|
|
|
@use crate::template_utils::*;
|
|
|
|
@use crate::templates::base;
|
|
|
|
@use crate::templates::partials::post_card;
|
|
|
|
@use crate::routes::*;
|
2019-10-07 19:08:20 +02:00
|
|
|
|
|
|
|
@(ctx: BaseContext, tl: Timeline, articles: Vec<Post>, all_tl: Vec<Timeline>, page: i32, n_pages: i32)
|
|
|
|
|
|
|
|
@:base(ctx, tl.name.clone(), {}, {}, {
|
|
|
|
<section class="flex wrap" dir="auto">
|
|
|
|
<h1 class="grow">@i18n_timeline_name(ctx.1, &tl.name)</h1>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
@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::<Vec<_>>()
|
|
|
|
)
|
|
|
|
|
|
|
|
@if !articles.is_empty() {
|
|
|
|
<div class="cards">
|
|
|
|
@for article in articles {
|
|
|
|
@:post_card(ctx, article)
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
} else {
|
|
|
|
<p class="center">@i18n!(ctx.1, "Nothing to see here yet.")</p>
|
|
|
|
}
|
|
|
|
@paginate(ctx.1, page, n_pages)
|
|
|
|
})
|