hyaenidae/server/templates/profiles/public.rs.html
asonix 4ff824b92d Delete 'Back' in favor of mobile nav query
Add submissions to home page
Add drafts page
Validate handle, display name, description, submission: title, description
Add block checks to submission iterator
Add user info to submission page
Abstract dark preference to a single source, not yet configurable
2021-01-10 22:09:47 -06:00

37 lines
1.5 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, {}, {
@:view("standalone", &pview.profile)
@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()),
])
})
})
}
@: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())
})
}
})
})