diff --git a/accounts/Cargo.toml b/accounts/Cargo.toml index 519b793..d1b5195 100644 --- a/accounts/Cargo.toml +++ b/accounts/Cargo.toml @@ -12,7 +12,6 @@ actix-web = "3.3.2" bcrypt = "0.9.0" event-listener = "2.5.1" futures = "0.3.8" -hyaenidae-toolkit = { version = "0.1.0", path = "../toolkit" } log = "0.4.11" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/accounts/src/forms/cookies.rs b/accounts/src/forms/cookies.rs index 553a864..cfa9fd1 100644 --- a/accounts/src/forms/cookies.rs +++ b/accounts/src/forms/cookies.rs @@ -9,7 +9,6 @@ pub type CookiesArgs = (Session, web::Data); #[derive(Debug)] pub struct CookiesState { state: State, - pub dark: bool, } pub fn cookies_page((cookies, state): CookiesPageArgs) -> Result { @@ -30,14 +29,9 @@ impl CookiesState { fn new(state: &State) -> Self { CookiesState { state: state.clone(), - dark: false, } } - pub fn dark(&mut self, dark: bool) { - self.dark = dark; - } - pub fn cookies_path(&self) -> String { self.state.pages.cookies_path() } diff --git a/accounts/src/forms/delete_user.rs b/accounts/src/forms/delete_user.rs index 97a9fde..d9689ce 100644 --- a/accounts/src/forms/delete_user.rs +++ b/accounts/src/forms/delete_user.rs @@ -21,7 +21,6 @@ pub struct DeleteUserState { state: State, form: Option, error: Option, - pub dark: bool, } pub fn delete_user_page((_, state): DeleteUserPageArgs) -> Result { @@ -45,7 +44,6 @@ impl DeleteUserState { state: state.clone(), form: None, error: None, - dark: false, } } @@ -54,14 +52,9 @@ impl DeleteUserState { state: state.clone(), form: form.into(), error: error.into(), - dark: false, } } - pub fn dark(&mut self, dark: bool) { - self.dark = dark; - } - pub fn delete_user_path(&self) -> String { self.state.pages.delete_user_path() } diff --git a/accounts/src/forms/login.rs b/accounts/src/forms/login.rs index cade09f..39b7541 100644 --- a/accounts/src/forms/login.rs +++ b/accounts/src/forms/login.rs @@ -27,7 +27,6 @@ pub struct LoginState { state: State, form: Option, error: Option, - pub dark: bool, } pub fn login_page( @@ -64,16 +63,11 @@ pub async fn login( } impl LoginState { - pub fn dark(&mut self, dark: bool) { - self.dark = dark; - } - fn new_empty(state: &State) -> Self { LoginState { state: state.clone(), form: None, error: None, - dark: false, } } @@ -82,7 +76,6 @@ impl LoginState { state: state.clone(), form: Some(form), error: Some(error), - dark: false, } } diff --git a/accounts/src/forms/logout.rs b/accounts/src/forms/logout.rs index f9241af..cabf0fc 100644 --- a/accounts/src/forms/logout.rs +++ b/accounts/src/forms/logout.rs @@ -36,10 +36,6 @@ impl LogoutState { self } - pub fn button<'a>(&self, btn: hyaenidae_toolkit::Button) -> hyaenidae_toolkit::Button { - btn.form(&self.logout_path()) - } - pub fn logout_path(&self) -> String { self.state.pages.logout_path() } diff --git a/accounts/src/forms/register.rs b/accounts/src/forms/register.rs index 0100b5c..24f00ca 100644 --- a/accounts/src/forms/register.rs +++ b/accounts/src/forms/register.rs @@ -28,7 +28,6 @@ pub struct RegisterState { state: State, form: Option, error: Option, - pub dark: bool, } pub fn register_page( @@ -70,7 +69,6 @@ impl RegisterState { state: state.clone(), form: None, error: None, - dark: false, } } @@ -79,14 +77,9 @@ impl RegisterState { state: state.clone(), form: Some(form), error: Some(error), - dark: false, } } - pub fn dark(&mut self, dark: bool) { - self.dark = dark; - } - pub fn register_path(&self) -> String { self.state.pages.register_path() } diff --git a/accounts/src/forms/update_password.rs b/accounts/src/forms/update_password.rs index 0331b5c..efa2cc2 100644 --- a/accounts/src/forms/update_password.rs +++ b/accounts/src/forms/update_password.rs @@ -21,7 +21,6 @@ pub struct UpdatePasswordState { state: State, form: Option, error: Option, - pub dark: bool, } pub fn update_password_page((_, state): UpdatePasswordPageArgs) -> UpdatePasswordState { @@ -45,7 +44,6 @@ impl UpdatePasswordState { state: state.clone(), form: None, error: None, - dark: false, } } @@ -58,14 +56,9 @@ impl UpdatePasswordState { state: state.clone(), form: Some(form), error: Some(error), - dark: false, } } - pub fn dark(&mut self, dark: bool) { - self.dark = dark; - } - pub fn update_password_path(&self) -> String { self.state.pages.update_password_path() } diff --git a/accounts/src/forms/update_username.rs b/accounts/src/forms/update_username.rs index a3f696e..6312571 100644 --- a/accounts/src/forms/update_username.rs +++ b/accounts/src/forms/update_username.rs @@ -20,7 +20,6 @@ pub struct UpdateUsernameState { state: State, form: Option, error: Option, - pub dark: bool, } pub fn update_username_page((_, state): UpdateUsernamePageArgs) -> UpdateUsernameState { @@ -44,7 +43,6 @@ impl UpdateUsernameState { state: state.clone(), form: None, error: None, - dark: false, } } @@ -57,14 +55,9 @@ impl UpdateUsernameState { state: state.clone(), form: Some(form), error: Some(error), - dark: false, } } - pub fn dark(&mut self, dark: bool) { - self.dark = dark; - } - pub fn update_username_path(&self) -> String { self.state.pages.update_username_path() } diff --git a/accounts/src/lib.rs b/accounts/src/lib.rs index 6c57e2b..e95705b 100644 --- a/accounts/src/lib.rs +++ b/accounts/src/lib.rs @@ -56,7 +56,6 @@ pub trait Pages { #[derive(Clone)] pub struct Config { - pub toolkit_path: String, pub key: Vec, pub https: bool, pub pages: Arc, @@ -64,7 +63,6 @@ pub struct Config { #[derive(Clone)] pub struct State { - toolkit_path: String, user_store: store::UserStore, db: Db, pages: Arc, @@ -82,7 +80,6 @@ impl State { pub fn state(config: &Config, db: Db) -> Result { Ok(State { - toolkit_path: config.toolkit_path.clone(), user_store: store::UserStore::build(&db)?, db, pages: Arc::clone(&config.pages), @@ -110,7 +107,6 @@ pub enum Error { impl std::fmt::Debug for Config { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("Config") - .field("toolkit_path", &self.toolkit_path) .field("key", &"Key") .field("https", &self.https) .field("pages", &"Box") @@ -121,7 +117,6 @@ impl std::fmt::Debug for Config { impl std::fmt::Debug for State { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("State") - .field("toolkit_path", &self.toolkit_path) .field("user_store", &"UserStore") .field("db", &"Db") .finish()