hyaenidae/server/templates/profiles/create/banner.rs.html
asonix 73d40e2f75 Cache associated records when iterating over comments or submissions
Rely more on the toolkit for UI
Fix a couple hard-coded dark modes
2021-01-12 22:39:59 -06:00

43 lines
1.7 KiB
HTML

@use crate::{templates::{layouts::home, profiles::view}, nav::NavState, profiles::Profile};
@use hyaenidae_toolkit::{templates::{button_group, card, card_body, card_title, file_input, statics::{button_js, file_input_js}}, Button, Card, FileInput};
@(banner_input: &FileInput, error: Option<String>, profile: &Profile, nav_state: &NavState)
@:home("Create Profile", "Create a new profile on Hyaenidae", nav_state, {
<script src="/toolkit/@file_input_js.name"></script>
<script src="/toolkit/@button_js.name"></script>
}, {
@:card(&Card::full_width().dark(nav_state.dark()), {
<form method="POST" action="/profiles/create/banner" enctype="multipart/form-data">
@:card_title({ Add a banner })
@:card_body({
<p>
This banner will be displayed on your profile behind your icon.
</p>
})
@if let Some(error) = error {
@:card_body({
<p>@error</p>
})
}
@:card_body({
@:file_input(banner_input)
})
@:card_body({
@:button_group(&[
&Button::primary("Next").dark(nav_state.dark()),
Button::outline("Back").href("/profiles/create/icon").dark(nav_state.dark()),
Button::primary_outline("Skip").href("/profiles/create/require-login").dark(nav_state.dark()),
Button::primary_outline("Skip
All").href("/profiles/create/done").dark(nav_state.dark()),
])
})
</form>
})
@:card(&Card::full_width().dark(nav_state.dark()), {
@:card_title({ Preview })
@:view(profile, nav_state.dark())
})
})