fix back-link and title for change_password

This commit is contained in:
glyph 2021-11-18 11:54:21 +02:00
parent 0b2b346bfc
commit 7f202ac7e9
1 changed files with 4 additions and 4 deletions

View File

@ -364,7 +364,7 @@ pub fn save_password_form(password_form: PasswordForm) -> Result<(), PeachWebErr
pub fn change_password(flash: Option<FlashMessage>, _auth: Authenticated) -> Template {
let mut context = ChangePasswordContext::build();
// set back icon link to network route
context.back = Some("/network".to_string());
context.back = Some("/settings/admin".to_string());
context.title = Some("Change Password".to_string());
// check to see if there is a flash message to display
if let Some(flash) = flash {
@ -383,7 +383,7 @@ pub fn change_password_post(password_form: Form<PasswordForm>, _auth: Authentica
Ok(_) => {
let mut context = ChangePasswordContext::build();
// set back icon link to network route
context.back = Some("/network".to_string());
context.back = Some("/settings/admin".to_string());
context.title = Some("Change Password".to_string());
context.flash_name = Some("success".to_string());
context.flash_msg = Some("New password is now saved".to_string());
@ -393,8 +393,8 @@ pub fn change_password_post(password_form: Form<PasswordForm>, _auth: Authentica
Err(err) => {
let mut context = ChangePasswordContext::build();
// set back icon link to network route
context.back = Some("/network".to_string());
context.title = Some("Configure DNS".to_string());
context.back = Some("/settings/admin".to_string());
context.title = Some("Change Password".to_string());
context.flash_name = Some("error".to_string());
context.flash_msg = Some(format!("Failed to save new password: {}", err));
Template::render("settings/admin/change_password", &context)