2021-01-30 18:48:37 +00:00
|
|
|
@use crate::ActixLoader;
|
2021-01-22 05:47:47 +00:00
|
|
|
@use crate::extensions::ProfileExt;
|
|
|
|
@use crate::nav::NavState;
|
|
|
|
@use crate::profiles::ViewProfileState;
|
|
|
|
@use crate::templates::layouts::home;
|
2021-01-15 02:42:30 +00:00
|
|
|
@use hyaenidae_toolkit::templates::button_group;
|
2021-01-11 04:09:47 +00:00
|
|
|
@use hyaenidae_toolkit::{templates::{card, card_body, card_section, card_title}, Card};
|
2021-01-22 05:47:47 +00:00
|
|
|
@use hyaenidae_toolkit::templates::profile;
|
2021-01-23 01:54:48 +00:00
|
|
|
@use hyaenidae_toolkit::{templates::{tile, tiles}, Tiles};
|
2021-01-30 18:48:37 +00:00
|
|
|
@use i18n_embed_fl::fl;
|
2021-01-09 04:35:35 +00:00
|
|
|
|
2021-01-30 18:48:37 +00:00
|
|
|
@(loader: &ActixLoader, pview: &ViewProfileState, nav_state: &NavState)
|
2021-01-09 04:35:35 +00:00
|
|
|
|
2021-01-30 18:48:37 +00:00
|
|
|
@:home(loader, &pview.profile().profile.name(), pview.profile().profile.description().unwrap_or(&fl!(loader, "profile-view-subtitle", profileName = pview.profile().profile.name())), nav_state, {}, {
|
2021-01-22 05:47:47 +00:00
|
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
2021-01-30 18:48:37 +00:00
|
|
|
@:profile(&pview.profile().heading(loader).dark(nav_state.dark()))
|
2021-01-22 05:47:47 +00:00
|
|
|
})
|
2021-01-30 18:48:37 +00:00
|
|
|
@if !pview.buttons(loader).is_empty() {
|
2021-01-22 05:47:47 +00:00
|
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
2021-01-30 18:48:37 +00:00
|
|
|
@:card_title({
|
|
|
|
@fl!(loader, "profile-actions-heading")
|
|
|
|
})
|
2021-01-10 01:49:33 +00:00
|
|
|
@:card_body({
|
2021-01-30 18:48:37 +00:00
|
|
|
@:button_group(&pview.buttons(loader))
|
2021-01-10 01:49:33 +00:00
|
|
|
})
|
2021-01-09 04:35:35 +00:00
|
|
|
})
|
2021-01-10 01:49:33 +00:00
|
|
|
}
|
2021-01-22 05:47:47 +00:00
|
|
|
@if !pview.submissions().is_empty() {
|
|
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
2021-01-30 18:48:37 +00:00
|
|
|
@:card_title({
|
|
|
|
@fl!(loader, "profile-submissions-heading")
|
|
|
|
})
|
2021-01-13 04:39:59 +00:00
|
|
|
@:card_section({
|
2021-01-23 01:54:48 +00:00
|
|
|
@:tiles(&Tiles::new(), {
|
2021-01-22 05:47:47 +00:00
|
|
|
@for t in pview.submissions() {
|
|
|
|
@:tile(&t)
|
2021-01-13 04:39:59 +00:00
|
|
|
}
|
2021-01-22 05:47:47 +00:00
|
|
|
})
|
2021-01-10 01:49:33 +00:00
|
|
|
})
|
2021-01-30 18:48:37 +00:00
|
|
|
@if pview.nav(loader).len() > 0 {
|
2021-01-13 04:39:59 +00:00
|
|
|
@:card_body({
|
2021-01-30 18:48:37 +00:00
|
|
|
@:button_group(&pview.nav(loader))
|
2021-01-13 04:39:59 +00:00
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2021-01-09 04:35:35 +00:00
|
|
|
})
|