2021-01-16 17:49:03 +00:00
|
|
|
@use crate::admin::{ReportsView, ServerView};
|
2021-01-14 04:46:34 +00:00
|
|
|
@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};
|
2021-01-16 17:49:03 +00:00
|
|
|
@use hyaenidae_toolkit::templates::text_input;
|
2021-01-14 04:46:34 +00:00
|
|
|
|
2021-01-16 17:49:03 +00:00
|
|
|
@(reports_view: &ReportsView, server_view: &ServerView, nav_state: &NavState)
|
2021-01-14 04:46:34 +00:00
|
|
|
|
|
|
|
@:home("Admin Settings", "Perform admin operations for Hyaenidae", nav_state, {}, {
|
2021-01-16 17:49:03 +00:00
|
|
|
@:card(Card::full_width().dark(nav_state.dark()), {
|
|
|
|
<form method="POST" action="@server_view.update_path()">
|
|
|
|
@:card_title({ Server Info })
|
|
|
|
@:card_body({
|
|
|
|
@:text_input(&server_view.title_input(nav_state.dark()))
|
|
|
|
@:text_input(&server_view.description_input(nav_state.dark()))
|
|
|
|
})
|
|
|
|
@:card_body({
|
|
|
|
@:button_group(&[
|
|
|
|
&Button::primary("Update"),
|
|
|
|
])
|
|
|
|
})
|
|
|
|
</form>
|
|
|
|
})
|
2021-01-14 04:46:34 +00:00
|
|
|
@:card(Card::full_width().dark(nav_state.dark()), {
|
|
|
|
@:card_title({ Reports })
|
2021-01-16 17:49:03 +00:00
|
|
|
@for report in reports_view.reports() {
|
2021-01-14 04:46:34 +00:00
|
|
|
@:card_body({
|
|
|
|
<div class="report">
|
|
|
|
<div class="report-head">
|
2021-01-16 17:49:03 +00:00
|
|
|
@if let Some(profile) = reports_view.profile(report) {
|
|
|
|
@:reporter(reports_view, report, nav_state.dark(), {
|
2021-01-14 04:46:34 +00:00
|
|
|
reported
|
|
|
|
|
|
|
|
@:link(Link::new_tab(&profile.view_path()).plain(true).dark(nav_state.dark()), {
|
|
|
|
@profile.name()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
2021-01-16 17:49:03 +00:00
|
|
|
@if let Some(submission) = reports_view.submission(report) {
|
|
|
|
@:reporter(reports_view, report, nav_state.dark(), {
|
2021-01-14 04:46:34 +00:00
|
|
|
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()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
2021-01-16 17:49:03 +00:00
|
|
|
@if let Some(comment) = reports_view.comment(report) {
|
|
|
|
@:reporter(reports_view, report, nav_state.dark(), {
|
2021-01-14 04:46:34 +00:00
|
|
|
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(&[
|
2021-01-16 17:49:03 +00:00
|
|
|
Button::secondary("View").href(&reports_view.view_path(report)).dark(nav_state.dark()),
|
2021-01-14 04:46:34 +00:00
|
|
|
])
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|