mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-27 12:30:31 +00:00
38302203f4
* Count items in database as much as possible * Fix the tests * Remove two useless queries * Run pragma directive before each sqlite connection * Pragma for tests too * Remove debug messages
60 lines
2.1 KiB
HTML
60 lines
2.1 KiB
HTML
@use plume_models::blogs::Blog;
|
|
@use plume_models::posts::Post;
|
|
@use plume_models::users::User;
|
|
@use templates::{base, partials::post_card};
|
|
@use template_utils::*;
|
|
@use routes::*;
|
|
|
|
@(ctx: BaseContext, blog: Blog, fqn: String, authors: &Vec<User>, total_articles: i64, page: i32, n_pages: i32, is_author: bool, posts: Vec<Post>)
|
|
|
|
@:base(ctx, blog.title.as_ref(), {}, {
|
|
<a href="@uri!(blogs::details: name = &fqn, page = _)">@blog.title</a>
|
|
}, {
|
|
<div class="hidden">
|
|
@for author in authors {
|
|
<div class="h-card">
|
|
<span class="p-name">@author.name(ctx.0)</span>
|
|
<a class="u-url" href="@author.ap_url"></a>
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="h-feed">
|
|
<h1><span class="p-name">@blog.title</span> <small>~@fqn</small></h1>
|
|
<p>@blog.summary</p>
|
|
<p>
|
|
@i18n!(ctx.1, "One author in this blog: ", "{0} authors in this blog: ", authors.len())
|
|
@for author in authors {
|
|
<a class="author p-author" href="@uri!(user::details: name = author.get_fqn(ctx.0))">@author.name(ctx.0)</a>
|
|
}
|
|
</p>
|
|
<p>
|
|
@i18n!(ctx.1, "One article in this blog", "{0} articles in this blog", total_articles)
|
|
</p>
|
|
|
|
<section>
|
|
<h2>
|
|
@i18n!(ctx.1, "Latest articles")
|
|
<small><a href="@uri!(blogs::atom_feed: name = &fqn)" title="Atom feed">@icon!("rss")</a></small>
|
|
</h2>
|
|
@if posts.len() < 1 {
|
|
<p>@i18n!(ctx.1, "No posts to see here yet.")</p>
|
|
}
|
|
@if is_author {
|
|
<a href="@uri!(posts::new: blog = &fqn)" class="button inline-block">@i18n!(ctx.1, "New article")</a>
|
|
}
|
|
<div class="cards">
|
|
@for article in posts {
|
|
@:post_card(ctx, article)
|
|
}
|
|
</div>
|
|
@paginate(ctx.1, page, n_pages)
|
|
</section>
|
|
</div>
|
|
@if is_author {
|
|
<h2>@i18n!(ctx.1, "Danger zone")</h2>
|
|
<p>@i18n!(ctx.1, "Be very careful, any action taken here can't be cancelled.")</p>
|
|
<form method="post" action="@uri!(blogs::delete: name = &fqn)">
|
|
<input type="submit" class="inline-block button destructive" value="@i18n!(ctx.1, "Delete this blog")">
|
|
</form>
|
|
}
|
|
})
|