68 lines
3.1 KiB
HTML
68 lines
3.1 KiB
HTML
@use crate::ActixLoader;
|
|
@use crate::extensions::ProfileExt;
|
|
@use crate::nav::NavState;
|
|
@use crate::templates::layouts::home;
|
|
@use crate::views::OwnedProfileView;
|
|
@use hyaenidae_toolkit::{templates::button_group, Button};
|
|
@use hyaenidae_toolkit::{templates::{card, card_body, card_section, card_title}, Card};
|
|
@use hyaenidae_toolkit::{templates::{icon, image}, Size};
|
|
@use hyaenidae_toolkit::{templates::link, Link};
|
|
@use i18n_embed_fl::fl;
|
|
|
|
@(loader: &ActixLoader, profiles: &[OwnedProfileView], nav_state: &NavState)
|
|
|
|
@:home(loader, &fl!(loader, "change-profiles-title"), &fl!(loader, "change-profiles-subtitle"), nav_state, {}, {
|
|
@if !profiles.is_empty() {
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
|
@for pview in profiles {
|
|
@:card_section({
|
|
<div class="profile-result">
|
|
@if let Some(img) = pview.banner_image(loader) {
|
|
<div class="profile-result--background">
|
|
@:image(&img)
|
|
</div>
|
|
}
|
|
<div class="profile-result--left">
|
|
<div class="profile-result--icon">
|
|
@:icon(&pview.icon(loader).size(Size::Small).dark(nav_state.dark()))
|
|
</div>
|
|
<div class="profile-result--meta">
|
|
<div class="profile-result--display-name">
|
|
@if let Some(display_name) = pview.profile.display_name() {
|
|
@:link(&Link::current_tab(&pview.profile.view_path()).plain(true), {
|
|
@Html(display_name)
|
|
})
|
|
}
|
|
</div>
|
|
<div class="profile-result--handle">
|
|
@:link(&Link::current_tab(&pview.profile.view_path()).plain(true), {
|
|
@pview.profile.full_handle()
|
|
})
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="profile-result--buttons">
|
|
<form method="POST" action="/profiles/change">
|
|
<input type="hidden" name="profile_id" value="@pview.profile.id()" />
|
|
@:button_group(&[
|
|
Button::primary(&fl!(loader, "change-profiles-select", profileName = pview.profile.name())),
|
|
])
|
|
</form>
|
|
</div>
|
|
</div>
|
|
})
|
|
}
|
|
})
|
|
}
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
|
@:card_title({
|
|
@fl!(loader, "change-profiles-create-heading")
|
|
})
|
|
@:card_body({
|
|
@:button_group(&[
|
|
Button::primary_outline(&fl!(loader, "change-profiles-create-button")).href("/profiles/create/handle"),
|
|
])
|
|
})
|
|
})
|
|
})
|