From d60b10f4d8c78acd018998a85776987cd90e66a0 Mon Sep 17 00:00:00 2001 From: jon ander Date: Fri, 11 Apr 2025 18:03:15 +0200 Subject: [PATCH] Refactor button rendering logic in home page; update button URLs and integrate button fragment for improved dynamic rendering --- .../controllers/UserController.java | 4 +-- .../templates/fragments/buttons.html | 25 +++++++++---------- src/main/resources/templates/home.html | 5 +--- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/ieslamar/GestionInventario/controllers/UserController.java b/src/main/java/com/ieslamar/GestionInventario/controllers/UserController.java index c5f9ba8..0d3f5f1 100644 --- a/src/main/java/com/ieslamar/GestionInventario/controllers/UserController.java +++ b/src/main/java/com/ieslamar/GestionInventario/controllers/UserController.java @@ -30,8 +30,8 @@ public class UserController { @GetMapping("/home") public String homePage(Model model) { List botones = List.of( - new BotonDTO("Inventario", "/Inventario/management", false, null), - new BotonDTO("Gestión", "/Inventario/management", true, "button_salir") + new BotonDTO("Inventario", "/management", false, null), + new BotonDTO("Gestión", "/management", true, null) ); model.addAttribute("buttons", botones); return "home"; // Retorna la vista home.html diff --git a/src/main/resources/templates/fragments/buttons.html b/src/main/resources/templates/fragments/buttons.html index c0b2013..ed02e5d 100644 --- a/src/main/resources/templates/fragments/buttons.html +++ b/src/main/resources/templates/fragments/buttons.html @@ -5,7 +5,18 @@
-
+
+ + + +
+
+
+ + + +
+
@@ -14,15 +25,3 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/resources/templates/home.html b/src/main/resources/templates/home.html index 9736a0f..502a0f6 100644 --- a/src/main/resources/templates/home.html +++ b/src/main/resources/templates/home.html @@ -7,11 +7,8 @@

Bienvenido a Gestión de Inventario

-
-
-
-
+