hyaenidae/server/templates/profiles/create/require_login.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

54 lines
2.1 KiB
HTML

@use crate::{templates::{layouts::home, profiles::view}, nav::NavState, profiles::Profile};
@use hyaenidae_toolkit::{templates::{button_group, card, card_body, card_title, statics::button_js}, Button, Card};
@(require_login: bool, error: Option<String>, profile: &Profile, nav_state: &NavState)
@:home("Create Profile", "Create a new profile on Hyaenidae", nav_state, {
<script src="/toolkit/@button_js.name"></script>
}, {
@:card(&Card::full_width().dark(nav_state.dark()), {
<form method="POST" action="/profiles/create/require-login">
@:card_title({ Require Login })
@:card_body({
<p>
If you would like to hide your profile from people without accounts, you
can check this box to restrict your profile page to logged in users.
</p>
})
@if let Some(error) = error {
@:card_body({
<p>@error</p>
})
}
@:card_body({
<label for="require_login">
@if require_login {
<input
type="checkbox"
name="require_login"
checked
/>
} else {
<input
type="checkbox"
name="require_login"
/>
}
<span>Require Login</span>
</label>
})
@:card_body({
@:button_group(&[
&Button::primary("Next").dark(nav_state.dark()),
Button::outline("Back").href("/profiles/create/banner").dark(nav_state.dark()),
Button::primary_outline("Skip").href("/profiles/create/done").dark(nav_state.dark()),
])
})
</form>
})
@:card(&Card::full_width().dark(true), {
@:card_title({ Preview })
@:view(profile, nav_state.dark())
})
})