hyaenidae/server/templates/profiles/public.rs.html
asonix 73d40e2f75 Cache associated records when iterating over comments or submissions
Rely more on the toolkit for UI
Fix a couple hard-coded dark modes
2021-01-12 22:39:59 -06:00

38 lines
1.7 KiB
HTML

@use crate::{templates::{layouts::home, profiles::{submission_tile, view}}, nav::NavState, profiles::ProfileView};
@use hyaenidae_toolkit::{templates::button_group, Button};
@use hyaenidae_toolkit::{templates::{card, card_body, card_section, card_title}, Card};
@(pview: &ProfileView, nav_state: &NavState)
@:home(&pview.profile.name(), pview.profile.description().unwrap_or(&format!("{}'s profile on Hyaenidae", pview.profile.name())), nav_state, {}, {
@:card(Card::full_width().dark(nav_state.dark()), { @:view(&pview.profile, nav_state.dark()) })
@if pview.is_self {
@:card(Card::full_width().dark(nav_state.dark()), {
@:card_title({ Profile Actions })
@:card_body({
@:button_group(&[
&Button::secondary("View Drafts").href("/profiles/drafts").dark(nav_state.dark()),
&Button::secondary("Edit Profile").href("/profiles/current").dark(nav_state.dark()),
&Button::secondary("Switch Profile").href("/profiles/change").dark(nav_state.dark()),
])
})
})
}
@if !pview.submissions.is_empty() {
@:card(Card::full_width().dark(nav_state.dark()), {
@:card_title({ Submissions })
@:card_section({
<div class="submission-tiles">
@for submission in &pview.submissions {
@:submission_tile(submission, pview.viewer, nav_state.dark())
}
</div>
})
@if pview.nav().len() > 0 {
@:card_body({
@:button_group(&pview.nav())
})
}
})
}
})