2018-12-06 17:54:16 +00:00
|
|
|
@use plume_models::notifications::Notification;
|
2020-01-21 06:02:03 +00:00
|
|
|
@use crate::templates::base;
|
|
|
|
@use crate::template_utils::*;
|
2018-12-06 17:54:16 +00:00
|
|
|
|
|
|
|
@(ctx: BaseContext, notifications: Vec<Notification>, page: i32, n_pages: i32)
|
|
|
|
|
2019-02-02 14:23:50 +00:00
|
|
|
@:base(ctx, i18n!(ctx.1, "Notifications"), {}, {}, {
|
2018-12-06 17:54:16 +00:00
|
|
|
<h1>@i18n!(ctx.1, "Notifications")</h1>
|
|
|
|
|
|
|
|
<div class="list">
|
|
|
|
@for notification in notifications {
|
|
|
|
<div class="card flex">
|
|
|
|
<i class="icon @notification.icon_class() left-icon"></i>
|
|
|
|
<main class="grow">
|
|
|
|
<h3>
|
|
|
|
@if let Some(url) = notification.get_url(ctx.0) {
|
|
|
|
<a href="@url">
|
2019-02-02 14:23:50 +00:00
|
|
|
@translate_notification(ctx, notification.clone())
|
2018-12-06 17:54:16 +00:00
|
|
|
</a>
|
|
|
|
} else {
|
2019-02-02 14:23:50 +00:00
|
|
|
@translate_notification(ctx, notification.clone())
|
2018-12-06 17:54:16 +00:00
|
|
|
}
|
|
|
|
</h3>
|
|
|
|
@if let Some(post) = notification.get_post(ctx.0) {
|
2018-12-29 08:36:07 +00:00
|
|
|
<p><a href="@post.url(ctx.0).unwrap_or_default()">@post.title</a></p>
|
2018-12-06 17:54:16 +00:00
|
|
|
}
|
|
|
|
</main>
|
|
|
|
<p><small>@notification.creation_date.format("%B %e, %H:%M")</small></p>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
@paginate(ctx.1, page, n_pages)
|
|
|
|
})
|