2021-01-15 05:51:17 +00:00
|
|
|
@use crate::nav::NavState;
|
|
|
|
@use crate::notifications::NotificationsView;
|
2021-01-16 04:50:15 +00:00
|
|
|
@use crate::templates::button_js;
|
2021-01-15 05:51:17 +00:00
|
|
|
@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)
|
|
|
|
|
2021-01-16 04:50:15 +00:00
|
|
|
@:home(&format!("Notifications: {}", view.count()), "Notifications on Hyaenidae", nav_state, {
|
|
|
|
@:button_js()
|
|
|
|
}, {
|
2021-01-22 05:47:47 +00:00
|
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
2021-01-15 05:51:17 +00:00
|
|
|
@:card_title({ Clear All })
|
|
|
|
@:card_body({
|
|
|
|
<p>This will clear all notifications except for Follow Requests</p>
|
|
|
|
})
|
|
|
|
@:card_body({
|
|
|
|
@:button_group(&[
|
2021-01-24 21:30:02 +00:00
|
|
|
view.clear_button(),
|
2021-01-15 05:51:17 +00:00
|
|
|
])
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@if view.has_follow_requests() {
|
2021-01-22 05:47:47 +00:00
|
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
2021-01-15 05:51:17 +00:00
|
|
|
@:card_title({ Follow Requests })
|
|
|
|
@for fr in view.follow_requests() {
|
|
|
|
@:card_body({
|
2021-01-22 05:47:47 +00:00
|
|
|
@:profile_box(&fr.view(), None, nav_state.dark(), {})
|
2021-01-16 04:50:15 +00:00
|
|
|
<div class="button-section">
|
2021-01-15 05:51:17 +00:00
|
|
|
@:button_group(&[
|
2021-01-24 21:30:02 +00:00
|
|
|
fr.accept_button(),
|
|
|
|
fr.reject_button(),
|
2021-01-15 05:51:17 +00:00
|
|
|
])
|
2021-01-16 04:50:15 +00:00
|
|
|
</div>
|
2021-01-15 05:51:17 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
@:card_body({
|
|
|
|
@:button_group(&[
|
2021-01-24 21:30:02 +00:00
|
|
|
view.accept_all_button(),
|
|
|
|
view.reject_all_button(),
|
2021-01-15 05:51:17 +00:00
|
|
|
])
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
@if view.has_comments() {
|
2021-01-22 05:47:47 +00:00
|
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
2021-01-15 05:51:17 +00:00
|
|
|
@:card_title({ Comments })
|
|
|
|
@for c in view.comments() {
|
|
|
|
@:card_body({
|
2021-01-24 04:04:27 +00:00
|
|
|
@:link(&c.author_link(), {
|
2021-01-28 02:59:58 +00:00
|
|
|
@Html(c.author_name())
|
2021-01-15 05:51:17 +00:00
|
|
|
})
|
2021-01-24 04:04:27 +00:00
|
|
|
@if let Some(l) = c.submission_link() {
|
2021-01-16 04:50:15 +00:00
|
|
|
commented on your submission:
|
2021-01-28 02:59:58 +00:00
|
|
|
@:link(&l, { @Html(c.submission_title()) })
|
2021-01-15 05:51:17 +00:00
|
|
|
}
|
2021-01-24 04:04:27 +00:00
|
|
|
@if let Some(l) = c.reply_to_link() {
|
2021-01-15 05:51:17 +00:00
|
|
|
replied to your
|
|
|
|
@:link(&l, { comment })
|
|
|
|
}
|
|
|
|
<div class="button-section">
|
|
|
|
@:button_group(&[
|
2021-01-24 21:30:02 +00:00
|
|
|
c.view_button(),
|
|
|
|
c.remove_button(),
|
2021-01-15 05:51:17 +00:00
|
|
|
])
|
|
|
|
</div>
|
|
|
|
})
|
|
|
|
}
|
|
|
|
@:card_body({
|
|
|
|
@:button_group(&[
|
2021-01-24 21:30:02 +00:00
|
|
|
view.clear_comments_button(),
|
2021-01-15 05:51:17 +00:00
|
|
|
])
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|