hyaenidae/server/templates/admin/report.rs.html
2021-01-27 20:59:58 -06:00

61 lines
2.1 KiB
HTML

@use crate::admin::ReportView;
@use crate::extensions::ProfileExt;
@use crate::nav::NavState;
@use crate::templates::admin::{comment_box, submission_box};
@use crate::templates::layouts::home;
@use hyaenidae_toolkit::{templates::button_group, Button};
@use hyaenidae_toolkit::{templates::{card, card_body, card_section, card_title}, Card};
@use hyaenidae_toolkit::{templates::link, Link};
@use hyaenidae_toolkit::templates::profile;
@use hyaenidae_toolkit::templates::select;
@use hyaenidae_toolkit::templates::text_input;
@(view: &ReportView, nav_state: &NavState)
@:home("Report", &format!("Report {}", view.id()), nav_state, {}, {
@:card(&Card::full_width().dark(nav_state.dark()), {
@:card_title({ Reported Item })
@if let Some(p) = view.profile() {
@:card_section({ @:profile(&p.heading().dark(nav_state.dark())) })
}
@if let Some(cv) = view.comment() {
@:card_body({
@:comment_box(cv.comment, &cv.author(), nav_state.dark())
})
}
@if let Some(sv) = view.submission() {
@:submission_box(&sv.submission(), &sv.author(), nav_state.dark())
}
@if let Some(author) = view.author() {
@:card_body({
Reported by
@:link(&Link::new_tab(&author.view_path()).plain(true), {
@Html(author.name())
})
})
}
@if let Some(note) = view.note() {
@:card_body({
<h4>Report Content</h4>
<p>@Html(note)</p>
})
}
})
@:card(&Card::full_width().dark(nav_state.dark()), {
<form method="POST" action="@view.update_path()">
@:card_title({ Actions })
@:card_body({
<div class="text-section">
@:select(view.select())
</div>
@:text_input(view.input())
})
@:card_body({
@:button_group(&[
Button::primary("Resolve"),
])
})
</form>
})
})