70 lines
3.1 KiB
HTML
70 lines
3.1 KiB
HTML
|
@use crate::admin::ReportsView;
|
||
|
@use crate::nav::NavState;
|
||
|
@use crate::templates::layouts::home;
|
||
|
@use crate::templates::admin::reporter;
|
||
|
@use hyaenidae_toolkit::{templates::button_group, Button};
|
||
|
@use hyaenidae_toolkit::{templates::{card, card_title, card_body}, Card};
|
||
|
@use hyaenidae_toolkit::{templates::link, Link};
|
||
|
|
||
|
@(view: &ReportsView, nav_state: &NavState)
|
||
|
|
||
|
@:home("Admin Settings", "Perform admin operations for Hyaenidae", nav_state, {}, {
|
||
|
@:card(Card::full_width().dark(nav_state.dark()), {
|
||
|
@:card_title({ Reports })
|
||
|
@for report in view.reports() {
|
||
|
@:card_body({
|
||
|
<div class="report">
|
||
|
<div class="report-head">
|
||
|
@if let Some(profile) = view.profile(report) {
|
||
|
@:reporter(view, report, nav_state.dark(), {
|
||
|
reported
|
||
|
|
||
|
@:link(Link::new_tab(&profile.view_path()).plain(true).dark(nav_state.dark()), {
|
||
|
@profile.name()
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
@if let Some(submission) = view.submission(report) {
|
||
|
@:reporter(view, report, nav_state.dark(), {
|
||
|
reported
|
||
|
@:link(Link::new_tab(&submission.author_path()).plain(true).dark(nav_state.dark()), {
|
||
|
@submission.author_name()'s
|
||
|
})
|
||
|
submission:
|
||
|
|
||
|
@:link(Link::new_tab(&submission.view_path()).plain(true).dark(nav_state.dark()), {
|
||
|
@submission.title()
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
@if let Some(comment) = view.comment(report) {
|
||
|
@:reporter(view, report, nav_state.dark(), {
|
||
|
reported
|
||
|
@:link(Link::new_tab(&comment.author_path()).plain(true).dark(nav_state.dark()), {
|
||
|
@comment.author_name()'s
|
||
|
})
|
||
|
comment:
|
||
|
|
||
|
@:link(Link::new_tab(&comment.view_path()).plain(true).dark(nav_state.dark()), {
|
||
|
@comment.body()
|
||
|
})
|
||
|
})
|
||
|
}
|
||
|
</div>
|
||
|
@if let Some(note) = report.note() {
|
||
|
<div class="report-description text-section">
|
||
|
<h4>Note:</h4>
|
||
|
<p>@note</p>
|
||
|
</div>
|
||
|
}
|
||
|
<div class="button-section report-actions">
|
||
|
@:button_group(&[
|
||
|
Button::secondary("View").href(&view.view_path(report)).dark(nav_state.dark()),
|
||
|
])
|
||
|
</div>
|
||
|
</div>
|
||
|
})
|
||
|
}
|
||
|
})
|
||
|
})
|