79 lines
2.7 KiB
HTML
79 lines
2.7 KiB
HTML
@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;
|
|
|
|
@(view: &NotificationsView, nav_state: &NavState)
|
|
|
|
@:home(&format!("Notifications: {}", view.count()), "Notifications on Hyaenidae", nav_state, {
|
|
@:button_js()
|
|
}, {
|
|
@: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(),
|
|
])
|
|
})
|
|
})
|
|
@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.view(), None, nav_state.dark(), {})
|
|
<div class="button-section">
|
|
@:button_group(&[
|
|
fr.accept_button(),
|
|
fr.reject_button(),
|
|
])
|
|
</div>
|
|
})
|
|
}
|
|
@:card_body({
|
|
@:button_group(&[
|
|
view.accept_all_button(),
|
|
view.reject_all_button(),
|
|
])
|
|
})
|
|
})
|
|
}
|
|
@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(), {
|
|
@c.author_name()
|
|
})
|
|
@if let Some(l) = c.submission_link() {
|
|
commented on your submission:
|
|
@:link(&l, { @c.submission_title() })
|
|
}
|
|
@if let Some(l) = c.reply_to_link() {
|
|
replied to your
|
|
@:link(&l, { comment })
|
|
}
|
|
<div class="button-section">
|
|
@:button_group(&[
|
|
c.view_button(),
|
|
c.remove_button(),
|
|
])
|
|
</div>
|
|
})
|
|
}
|
|
@:card_body({
|
|
@:button_group(&[
|
|
view.clear_comments_button(),
|
|
])
|
|
})
|
|
})
|
|
}
|
|
})
|