Implemented user menu. Replaced favicon with app logo.
This commit is contained in:
@@ -37,6 +37,7 @@ pub struct User {
|
||||
pub login: String,
|
||||
pub password: String,
|
||||
pub full_name: Option<String>,
|
||||
#[validate(email(message = "Enter valid email address"))]
|
||||
pub email: Option<String>,
|
||||
pub admin: bool,
|
||||
pub get_emails: bool,
|
||||
@@ -48,6 +49,59 @@ impl User {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, Validate, Default)]
|
||||
pub struct UserProfile {
|
||||
login: String,
|
||||
full_name: String,
|
||||
#[validate(email(message = "Enter valid email address"))]
|
||||
email: String,
|
||||
get_emails: Option<String>
|
||||
}
|
||||
|
||||
impl UserProfile {
|
||||
|
||||
pub fn login(&self) -> &str {
|
||||
&self.login
|
||||
}
|
||||
|
||||
pub fn full_name(&self) -> &str {
|
||||
&self.full_name
|
||||
}
|
||||
|
||||
pub fn email(&self) -> &str {
|
||||
&self.email
|
||||
}
|
||||
|
||||
pub fn get_emails(&self) -> bool {
|
||||
self.get_emails.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Eq, Validate, Default)]
|
||||
pub struct PwdChange {
|
||||
login: String,
|
||||
old_password: String,
|
||||
#[validate(length(min = 1, message = "Enter new password"),
|
||||
must_match(other = "password_ver", message = "Passwords doesn't match"))]
|
||||
password: String,
|
||||
password_ver: String
|
||||
}
|
||||
|
||||
impl PwdChange {
|
||||
pub fn login(&self) -> &str {
|
||||
&self.login
|
||||
}
|
||||
pub fn old_password(&self) -> &str {
|
||||
&self.old_password
|
||||
}
|
||||
pub fn password(&self) -> &str {
|
||||
&self.password
|
||||
}
|
||||
pub fn password_ver(&self) -> &str {
|
||||
&self.password_ver
|
||||
}
|
||||
}
|
||||
|
||||
/*pub struct Property {
|
||||
id: u16,
|
||||
name: String,
|
||||
|
||||
Reference in New Issue
Block a user