2021-01-10 01:49:33 +00:00
|
|
|
@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};
|
2021-01-09 04:35:35 +00:00
|
|
|
|
2021-01-10 01:49:33 +00:00
|
|
|
@(pview: &ProfileView, nav_state: &NavState)
|
2021-01-09 04:35:35 +00:00
|
|
|
|
2021-01-10 01:49:33 +00:00
|
|
|
@: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),
|
|
|
|
])
|
|
|
|
})
|
2021-01-09 04:35:35 +00:00
|
|
|
})
|
2021-01-10 01:49:33 +00:00
|
|
|
}
|
|
|
|
@: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())
|
|
|
|
})
|
|
|
|
}
|
2021-01-09 04:35:35 +00:00
|
|
|
})
|
|
|
|
})
|