Accounts: Update to new toolkit api
This commit is contained in:
parent
c86f4b3ff2
commit
7e2141d1b5
|
@ -36,7 +36,7 @@ impl LogoutState {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn button<'a>(&self, btn: &'a hyaenidae_toolkit::Button) -> &'a hyaenidae_toolkit::Button {
|
||||
pub fn button<'a>(&self, btn: hyaenidae_toolkit::Button) -> hyaenidae_toolkit::Button {
|
||||
btn.form(&self.logout_path())
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
@:card_body({
|
||||
<form method="POST" action="@state.cookies_path()">
|
||||
@:button_group(&[
|
||||
&Button::primary("Accept Cookies").dark(state.dark),
|
||||
Button::primary("Accept Cookies").dark(state.dark),
|
||||
Button::primary_outline("Cancel").href(&state.home_path()).dark(state.dark),
|
||||
])
|
||||
</form>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
})
|
||||
@:card_body({
|
||||
@:button_group(&[
|
||||
&Button::primary("Delete Account").dark(state.dark),
|
||||
Button::primary("Delete Account").dark(state.dark),
|
||||
Button::primary_outline("Cancel").href(&state.accounts_path()).dark(state.dark),
|
||||
])
|
||||
})
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
@(name: &str, title: &str, value: Option<String>, error: Option<String>, dark: bool)
|
||||
|
||||
@:text_input(TextInput::new(name).title(title).value_opt(value).error_opt(error).password().dark(dark))
|
||||
@:text_input(&TextInput::new(name).title(title).value_opt(value).error_opt(error).password().dark(dark))
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
@(name: &str, title: &str, value: Option<String>, error: Option<String>, dark:bool)
|
||||
|
||||
@:text_input(TextInput::new(name).title(title).value_opt(value).error_opt(error).dark(dark))
|
||||
@:text_input(&TextInput::new(name).title(title).value_opt(value).error_opt(error).dark(dark))
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
})
|
||||
@:card_body({
|
||||
@:button_group(&[
|
||||
&Button::primary("Login").dark(state.dark),
|
||||
Button::primary("Login").dark(state.dark),
|
||||
Button::primary_outline("Cancel").href(&state.home_path()).dark(state.dark),
|
||||
])
|
||||
})
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@use crate::LogoutState;
|
||||
@use hyaenidae_toolkit::{templates::button_group, Button};
|
||||
|
||||
@(btn: &Button, state: &LogoutState)
|
||||
@(btn: Button, state: &LogoutState)
|
||||
|
||||
@:button_group(&[state.button(btn)])
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
})
|
||||
@:card_body({
|
||||
@:button_group(&[
|
||||
&Button::primary("Register").dark(state.dark),
|
||||
Button::primary("Register").dark(state.dark),
|
||||
Button::primary_outline("Cancel").href(&state.home_path()).dark(state.dark),
|
||||
])
|
||||
})
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
@:password_input("password", "Password", state.password(), state.password_error(), state.dark)
|
||||
})
|
||||
@:card_body({
|
||||
@:button_group(&[&Button::primary("Update Password").dark(state.dark)])
|
||||
@:button_group(&[Button::primary("Update Password").dark(state.dark)])
|
||||
})
|
||||
</form>
|
||||
})
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
@:password_input("password", "Password", state.password(), state.password_error(), state.dark)
|
||||
})
|
||||
@:card_body({
|
||||
@:button_group(&[&Button::primary("Update Username").dark(state.dark)])
|
||||
@:button_group(&[Button::primary("Update Username").dark(state.dark)])
|
||||
})
|
||||
</form>
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue