hyaenidae/server/templates/profiles/public.rs.html

39 lines
1.6 KiB
HTML
Raw Normal View History

@use crate::{templates::{layouts::home, profiles::{submission_tile, view}}, nav::NavState, profiles::ProfileView};
@use hyaenidae_toolkit::{templates::{button_group, card, card_body, card_title, link}, Button, Card, Link};
@(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 account-page", &pview.profile)
@if pview.is_self {
@:card(Card::full_width().dark(pview.dark), {
@:card_title({ Profile Actions })
@:card_body({
@:button_group(&[
&Button::secondary("Edit Profile").href("/profiles/current").dark(pview.dark),
&Button::secondary("Switch Profile").href("/profiles/change").dark(pview.dark),
])
})
})
}
@:card(Card::full_width().dark(pview.dark), {
@:card_title({ Submissions })
<div class="submission-tiles">
@for submission in &pview.submissions {
@if let Some(key) = submission.pictrs_key() {
@:link(&Link::current_tab(&submission.view_path()).dark(pview.dark), {
<div class="image-box">
@:submission_tile(key, submission.title())
</div>
})
}
}
</div>
@if pview.nav().len() > 0 {
@:card_body({
@:button_group(&pview.nav())
})
}
})
})