mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-23 03:51:00 +00:00
7eef4643c8
Internationalization now uses proc-macros that generate the .pot file automatically.
35 lines
1.8 KiB
HTML
35 lines
1.8 KiB
HTML
@use templates::{base, partials::*};
|
|
@use template_utils::*;
|
|
@use plume_models::instance::Instance;
|
|
@use plume_models::posts::Post;
|
|
@use routes::*;
|
|
|
|
@(ctx: BaseContext, instance: Instance, n_users: i64, n_articles: i64, local: Vec<Post>, federated: Vec<Post>, user_feed: Option<Vec<Post>>)
|
|
|
|
@:base(ctx, instance.name.clone(), {}, {}, {
|
|
<h1>@i18n!(ctx.1, "Welcome on {}"; instance.name.as_str())</h1>
|
|
|
|
@if ctx.2.is_some() {
|
|
@tabs(&[
|
|
(&uri!(instance::index).to_string(), i18n!(ctx.1, "Latest articles"), true),
|
|
(&uri!(instance::feed: _).to_string(), i18n!(ctx.1, "Your feed"), false),
|
|
(&uri!(instance::federated: _).to_string(), i18n!(ctx.1, "Federated feed"), false),
|
|
(&uri!(instance::local: _).to_string(), i18n!(ctx.1, "Local feed"), false),
|
|
])
|
|
|
|
@:home_feed(ctx, user_feed.unwrap_or_default(), &uri!(instance::feed: _).to_string(), i18n!(ctx.1, "Your feed"))
|
|
@:home_feed(ctx, federated, &uri!(instance::federated: _).to_string(), i18n!(ctx.1, "Federated feed"))
|
|
@:home_feed(ctx, local, &uri!(instance::local: _).to_string(), i18n!(ctx.1, "Local feed"))
|
|
@:instance_description(ctx, instance, n_users, n_articles)
|
|
} else {
|
|
@tabs(&[
|
|
(&uri!(instance::index).to_string(), i18n!(ctx.1, "Latest articles"), true),
|
|
(&uri!(instance::federated: _).to_string(), i18n!(ctx.1, "Federated feed"), false),
|
|
(&uri!(instance::local: _).to_string(), i18n!(ctx.1, "Local feed"), false),
|
|
])
|
|
|
|
@:home_feed(ctx, federated, &uri!(instance::federated: _).to_string(), i18n!(ctx.1, "Federated feed"))
|
|
@:home_feed(ctx, local, &uri!(instance::local: _).to_string(), i18n!(ctx.1, "Local feed"))
|
|
@:instance_description(ctx, instance, n_users, n_articles)
|
|
}
|
|
})
|