2018-12-06 18:54:16 +01:00
|
|
|
@use templates::{base, partials::post_card};
|
|
|
|
@use template_utils::*;
|
|
|
|
@use plume_models::blogs::Blog;
|
|
|
|
@use plume_models::posts::Post;
|
2018-12-07 12:05:01 +01:00
|
|
|
@use routes::*;
|
2018-12-06 18:54:16 +01:00
|
|
|
|
|
|
|
@(ctx: BaseContext, blogs: Vec<Blog>, drafts: Vec<Post>)
|
|
|
|
|
|
|
|
@:base(ctx, "Your Dashboard", {}, {}, {
|
|
|
|
<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">
|
2018-12-13 22:20:19 +01:00
|
|
|
<h3><a href="@uri!(blogs::details: name = blog.actor_id, page = _)">@blog.title</a></h3>
|
2018-12-06 18:54:16 +01:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
2018-12-07 12:05:01 +01:00
|
|
|
<a class="button" href="@uri!(blogs::new)">@i18n!(ctx.1, "Start a new blog")</a>
|
2018-12-06 18:54:16 +01: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>
|
2018-12-07 12:05:01 +01:00
|
|
|
<a class="button" href="@uri!(medias::list)">@i18n!(ctx.1, "Go to your gallery")</a>
|
2018-12-06 18:54:16 +01:00
|
|
|
</section>
|
|
|
|
})
|