hyaenidae/templates/profiles/report.rs.html

38 lines
1.5 KiB
HTML

@use crate::ActixLoader;
@use crate::extensions::ProfileExt;
@use crate::templates::button_js;
@use crate::{templates::layouts::home, nav::NavState, profiles::ReportView};
@use hyaenidae_toolkit::{templates::button_group, Button};
@use hyaenidae_toolkit::{templates::{card, card_body, card_title}, Card};
@use hyaenidae_toolkit::templates::profile;
@use hyaenidae_toolkit::templates::text_input;
@use i18n_embed_fl::fl;
@(loader: &ActixLoader, rview: &ReportView, nav_state: &NavState)
@:home(loader, &fl!(loader, "report-profile-heading"), rview.profile.description().unwrap_or(&fl!(loader, "report-profile-description", profileName = rview.profile.name())), nav_state, {
@:button_js()
}, {
@:card(&Card::full_width().dark(nav_state.dark()), {
@:profile(&rview.profile().heading(loader).dark(nav_state.dark()))
})
@:card(&Card::full_width().dark(nav_state.dark()), {
<form method="POST" action="@rview.profile.report_path()">
@:card_title({
@fl!(loader, "report-profile-heading")
})
@:card_body({
<p>@fl!(loader, "report-description")</p>
@:text_input(&rview.input(loader).dark(nav_state.dark()))
})
@:card_body({
@:button_group(&[
Button::primary(&fl!(loader, "report-button")),
Button::secondary(&fl!(loader, "back-to-profile-button")).href(&rview.profile.view_path()),
])
})
</form>
})
})