2018-12-06 17:54:16 +00:00
|
|
|
@use plume_models::blogs::Blog;
|
|
|
|
@use plume_models::posts::Post;
|
2020-01-21 06:02:03 +00:00
|
|
|
@use crate::templates::{base, partials::post_card};
|
|
|
|
@use crate::template_utils::*;
|
|
|
|
@use crate::routes::*;
|
2018-12-06 17:54:16 +00:00
|
|
|
|
|
|
|
@(ctx: BaseContext, blogs: Vec<Blog>, drafts: Vec<Post>)
|
|
|
|
|
2019-02-02 14:23:50 +00:00
|
|
|
@:base(ctx, i18n!(ctx.1, "Your Dashboard"), {}, {}, {
|
2018-12-06 17:54:16 +00:00
|
|
|
<h1>@i18n!(ctx.1, "Your Dashboard")</h1>
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<h2>@i18n!(ctx.1, "Your Blogs")</h2>
|
|
|
|
@if blogs.is_empty() {
|
|
|
|
<p>@i18n!(ctx.1, "You don't have any blog yet. Create your own, or ask to join one.")</p>
|
|
|
|
}
|
|
|
|
<div class="cards">
|
|
|
|
@for blog in blogs {
|
|
|
|
<div class="card">
|
2019-03-22 18:51:36 +00:00
|
|
|
@if blog.banner_id.is_some() {
|
2022-01-02 17:35:04 +00:00
|
|
|
<a class="cover-link" href="@uri!(blogs::details: name = &blog.actor_id, page = _)">
|
|
|
|
<div class="cover" style="background-image: url('@Html(blog.banner_url(ctx.0).unwrap_or_default())')">
|
|
|
|
</div>
|
|
|
|
</a>
|
2019-03-22 18:51:36 +00:00
|
|
|
}
|
2018-12-13 21:20:19 +00:00
|
|
|
<h3><a href="@uri!(blogs::details: name = blog.actor_id, page = _)">@blog.title</a></h3>
|
2019-03-22 18:51:36 +00:00
|
|
|
<main><p>@Html(blog.summary_html)</p></main>
|
2018-12-06 17:54:16 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
2018-12-07 11:05:01 +00:00
|
|
|
<a class="button" href="@uri!(blogs::new)">@i18n!(ctx.1, "Start a new blog")</a>
|
2018-12-06 17:54:16 +00:00
|
|
|
</section>
|
|
|
|
|
|
|
|
@if !drafts.is_empty() {
|
|
|
|
<section>
|
|
|
|
<h2>@i18n!(ctx.1, "Your Drafts")</h2>
|
|
|
|
<div class="cards">
|
|
|
|
@for draft in drafts {
|
|
|
|
@:post_card(ctx, draft)
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
}
|
|
|
|
|
|
|
|
<section>
|
|
|
|
<h2>@i18n!(ctx.1, "Your media")</h2>
|
2019-03-06 13:11:36 +00:00
|
|
|
<a class="button" href="@uri!(medias::list: page = _)">@i18n!(ctx.1, "Go to your gallery")</a>
|
2018-12-06 17:54:16 +00:00
|
|
|
</section>
|
|
|
|
})
|