💄 (user): Unifica botoneras y enlaces de vuelta

- "Guardar" y "Cancelar" en la misma fila en todos los formularios.
- "Volver" sólo en fichas de sólo lectura.
- Búsqueda de usuarios con `form::input::Field` y botones de alta en
  estilo principal.
This commit is contained in:
Manuel Cillero 2026-11-09 23:04:59 +01:00
parent 698b917fb1
commit bdc94be92a
15 changed files with 115 additions and 114 deletions

View file

@ -76,7 +76,6 @@ pub(crate) async fn new_get(
web::Query(waypoint): web::Query<Waypoint>,
) -> Result<Response, ErrorPage> {
let page = Page::admin(request);
let back_href = waypoint.or(page.route(ADMIN_ROLES_PATH.as_str()));
let title = Lc::t("title-admin-role-new", &LOCALES_USER);
Ok(page
.with_title(title)
@ -85,7 +84,6 @@ pub(crate) async fn new_get(
.with_mode(RoleFormMode::New)
.with_waypoint(waypoint),
)
.with_child(back_link(back_href))
.render()
.await
.into_response())
@ -125,7 +123,6 @@ pub(crate) async fn new_post(
}
Err(err) => {
let page = Page::admin(request);
let back_href = waypoint.or(page.route(ADMIN_ROLES_PATH.as_str()));
let form_component = RoleForm::new()
.with_mode(RoleFormMode::New)
.with_machine_name(form.machine_name)
@ -138,7 +135,6 @@ pub(crate) async fn new_post(
Ok(page
.with_title(title)
.with_child(form_component)
.with_child(back_link(back_href))
.render()
.await
.into_response())
@ -163,7 +159,6 @@ pub(crate) async fn edit_get(
}
let page = Page::admin(request);
let back_href = waypoint.or(page.route(ADMIN_ROLES_PATH.as_str()));
let title = Lc::t("title-admin-role-edit", &LOCALES_USER);
Ok(page
@ -178,7 +173,6 @@ pub(crate) async fn edit_get(
.with_weight(role.weight)
.with_waypoint(waypoint),
)
.with_child(back_link(back_href))
.render()
.await
.into_response())
@ -224,7 +218,6 @@ pub(crate) async fn edit_post(
.map(|role| role.machine_name)
.unwrap_or_default();
let page = Page::admin(request);
let back_href = waypoint.or(page.route(ADMIN_ROLES_PATH.as_str()));
let form_component = RoleForm::new()
.with_mode(RoleFormMode::Edit)
.with_role_id(Some(id))
@ -238,7 +231,6 @@ pub(crate) async fn edit_post(
Ok(page
.with_title(title)
.with_child(form_component)
.with_child(back_link(back_href))
.render()
.await
.into_response())
@ -481,7 +473,6 @@ pub(crate) async fn permissions_get(
let page = Page::admin(request);
let groups = build_permission_groups(&selected, page.context());
let back_href = waypoint.or(page.route(ADMIN_ROLES_PATH.as_str()));
let title = Lc::t("title-admin-role-permissions", &LOCALES_USER);
Ok(page
@ -492,7 +483,6 @@ pub(crate) async fn permissions_get(
.with_groups(groups)
.with_waypoint(waypoint),
)
.with_child(back_link(back_href))
.render()
.await
.into_response())
@ -530,7 +520,6 @@ pub(crate) async fn permissions_post(
let page = Page::admin(request);
let groups = build_permission_groups(&form.permission_keys, page.context());
let back_href = waypoint.or(page.route(ADMIN_ROLES_PATH.as_str()));
let form_component = RolePermissionsForm::new()
.with_role_id(id)
.with_groups(groups)
@ -540,7 +529,6 @@ pub(crate) async fn permissions_post(
Ok(page
.with_title(title)
.with_child(form_component)
.with_child(back_link(back_href))
.render()
.await
.into_response())