Accounts: Update to new toolkit api

This commit is contained in:
asonix 2021-01-21 23:42:48 -06:00
parent c86f4b3ff2
commit 7e2141d1b5
10 changed files with 10 additions and 10 deletions

View file

@ -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())
}

View file

@ -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>

View file

@ -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),
])
})

View file

@ -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))

View file

@ -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))

View file

@ -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),
])
})

View file

@ -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)])

View file

@ -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),
])
})

View file

@ -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>
})

View file

@ -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>
})