asonix
934ddd76ff
Reorganize files a bit Add a Pagination trait to guide with paging in the future Add extension traits for Profile, Comment, and Submission Async-ify more things, but not all things
33 lines
1.3 KiB
HTML
33 lines
1.3 KiB
HTML
@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_title}, Card};
|
|
@use hyaenidae_toolkit::templates::profile;
|
|
|
|
@(profiles: &[OwnedProfileView], nav_state: &NavState)
|
|
|
|
@:home("Switch Profile", "Select the profile you wish to use", nav_state, {}, {
|
|
@for pview in profiles {
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
|
@:profile(&pview.heading().dark(nav_state.dark()))
|
|
@:card_body({
|
|
<form method="POST" action="/profiles/change">
|
|
<input type="hidden" name="profile_id" value="@pview.profile.id()" />
|
|
@:button_group(&[
|
|
Button::primary(&format!("Select {}", pview.profile.name())).dark(nav_state.dark()),
|
|
])
|
|
</form>
|
|
})
|
|
})
|
|
}
|
|
@:card(&Card::full_width().dark(nav_state.dark()), {
|
|
@:card_title({ Create a New Profile })
|
|
@:card_body({
|
|
@:button_group(&[
|
|
Button::primary_outline("Create").href("/profiles/create/handle").dark(nav_state.dark()),
|
|
])
|
|
})
|
|
})
|
|
})
|