76 lines
2.7 KiB
HTML
76 lines
2.7 KiB
HTML
|
@use crate::nav::NavState;
|
||
|
@use crate::notifications::NotificationsView;
|
||
|
@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;
|
||
|
|
||
|
@(view: &NotificationsView, nav_state: &NavState)
|
||
|
|
||
|
@:home(&format!("Notifications: {}", view.count()), "Notifications on Hyaenidae", nav_state, {}, {
|
||
|
@:card(Card::full_width().dark(nav_state.dark()), {
|
||
|
@:card_title({ Clear All })
|
||
|
@:card_body({
|
||
|
<p>This will clear all notifications except for Follow Requests</p>
|
||
|
})
|
||
|
@:card_body({
|
||
|
@:button_group(&[
|
||
|
&view.clear_button(nav_state.dark()),
|
||
|
])
|
||
|
})
|
||
|
})
|
||
|
@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(fr.profile, None, nav_state.dark(), {
|
||
|
@:button_group(&[
|
||
|
&fr.accept_button(nav_state.dark()),
|
||
|
&fr.reject_button(nav_state.dark()),
|
||
|
])
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
@:card_body({
|
||
|
@:button_group(&[
|
||
|
&view.accept_all_button(nav_state.dark()),
|
||
|
&view.reject_all_button(nav_state.dark()),
|
||
|
])
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
@if view.has_comments() {
|
||
|
@:card(Card::full_width().dark(nav_state.dark()), {
|
||
|
@:card_title({ Comments })
|
||
|
@for c in view.comments() {
|
||
|
@:card_body({
|
||
|
@:link(&c.author_link(nav_state.dark()), {
|
||
|
@c.author_name()
|
||
|
})
|
||
|
@if let Some(l) = c.submission_link(nav_state.dark()) {
|
||
|
commented on your
|
||
|
@:link(&l, { submission })
|
||
|
}
|
||
|
@if let Some(l) = c.reply_to_link(nav_state.dark()) {
|
||
|
replied to your
|
||
|
@:link(&l, { comment })
|
||
|
}
|
||
|
<div class="button-section">
|
||
|
@:button_group(&[
|
||
|
&c.view_button(nav_state.dark()),
|
||
|
&c.remove_button(nav_state.dark()),
|
||
|
])
|
||
|
</div>
|
||
|
})
|
||
|
}
|
||
|
@:card_body({
|
||
|
@:button_group(&[
|
||
|
&view.clear_comments_button(nav_state.dark()),
|
||
|
])
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
})
|