@use crate::ActixLoader; @use crate::nav::NavState; @use crate::notifications::NotificationsView; @use crate::templates::button_js; @use crate::templates::layouts::home; @use crate::templates::submissions::profile_box; @use hyaenidae_toolkit::templates::button_group; @use hyaenidae_toolkit::{templates::{card, card_body, card_title}, Card}; @use hyaenidae_toolkit::templates::link; @use i18n_embed_fl::fl; @(loader: &ActixLoader, view: &NotificationsView, nav_state: &NavState) @:home(loader, &fl!(loader, "notification-count", count = view.count()), &fl!(loader, "notification-subtitle"), nav_state, { @:button_js() }, { @:card(&Card::full_width().dark(nav_state.dark()), { @:card_title({ @fl!(loader, "notification-clear-all-heading") }) @:card_body({

@fl!(loader, "notification-clear-all-description")

}) @:card_body({ @:button_group(&[ view.clear_button(loader), ]) }) }) @if view.has_follow_requests() { @:card(&Card::full_width().dark(nav_state.dark()), { @:card_title({ Follow Requests }) @for fr in view.follow_requests() { @:card_body({
@:profile_box(loader, &fr.view(), None, nav_state.dark(), {})
@:button_group(&[ fr.accept_button(loader), fr.reject_button(loader), ])
}) } @:card_body({ @:button_group(&[ view.accept_all_button(loader), view.reject_all_button(loader), ]) }) }) } @if view.has_comments() { @:card(&Card::full_width().dark(nav_state.dark()), { @:card_title({ @fl!(loader, "notification-comment-heading") }) @for c in view.comments() { @:card_body({
@:link(&c.author_link(), { @Html(c.author_name()) }) @if let Some(l) = c.submission_link() { @fl!(loader, "notification-commented") @:link(&l, { @Html(c.submission_title()) }) } @if let Some(l) = c.reply_to_link() { @fl!(loader, "notification-replied") @:link(&l, { @fl!(loader, "notification-comment-comment") }) }
@:button_group(&[ c.view_button(loader), c.remove_button(loader), ])
}) } @:card_body({ @:button_group(&[ view.clear_comments_button(loader), ]) }) }) } })