Plume/templates/users/dashboard.rs.html
Baptiste Gelez 70af57c6e1
Use Ructe (#327)
All the template are now compiled at compile-time with the `ructe` crate.

I preferred to use it instead of askama because it allows more complex Rust expressions, where askama only supports a small subset of expressions and doesn't allow them everywhere (for instance, `{{ macro!() | filter }}` would result in a parsing error).

The diff is quite huge, but there is normally no changes in functionality.

Fixes #161 and unblocks #110 and #273
2018-12-06 18:54:16 +01:00

42 lines
1.2 KiB
HTML

@use templates::{base, partials::post_card};
@use template_utils::*;
@use plume_models::blogs::Blog;
@use plume_models::posts::Post;
@(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">
<h3><a href="/~/@blog.actor_id/">@blog.title</a></h3>
</div>
}
</div>
<a class="button" href="/blogs/new">@i18n!(ctx.1, "Start a new blog")</a>
</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>
<a class="button" href="/medias">@i18n!(ctx.1, "Go to your gallery")</a>
</section>
})