This commit is contained in:
Lizandro Guarnizo
2026-05-01 10:28:22 -05:00
parent caec7bb5e8
commit 88c65cd405
2 changed files with 28 additions and 6 deletions
+27
View File
@@ -0,0 +1,27 @@
<!-- Dashboard -->
<div class="bg-white rounded-lg shadow p-6">
<div class="mb-6">
<h1 class="text-2xl font-bold text-slate-800">Bienvenido{{if .user}}, {{index .user "name"}}{{end}}</h1>
<p class="text-sm text-slate-500 mt-1">Panel de administración · U-site</p>
</div>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
<!-- Acceso rápido a módulos -->
{{if .modules}}
{{range .modules}}
<a href="{{.url}}" class="flex items-center gap-3 p-4 rounded-lg border border-slate-200 hover:border-[#8eb02f] hover:shadow-sm transition-all group">
<div class="w-9 h-9 rounded-lg flex items-center justify-center bg-[#8eb02f]/10 group-hover:bg-[#8eb02f]/20 transition-colors">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-[#8eb02f]" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.5">
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z" />
</svg>
</div>
<span class="text-sm font-medium text-slate-700 group-hover:text-[#6d8c24]">{{.nombre}}</span>
</a>
{{end}}
{{else}}
<div class="col-span-full text-center py-12 text-slate-400 text-sm">
No hay módulos asignados a tu perfil.
</div>
{{end}}
</div>
</div>
+1 -6
View File
@@ -21,12 +21,7 @@ func UserRoutes(app fiber.Router) {
protected.Get("/web", func(c *fiber.Ctx) error { return c.Redirect("/", http.StatusSeeOther) })
app.Get("/web", func(c *fiber.Ctx) error { return c.Redirect("/", http.StatusSeeOther) })
protected.Get("/", controllers.App)
protected.Get("/me", controllers.Me)
// Rutas de módulos
protected.Get("/modules", middlewares.MenuMiddleware, controllers.Modules) // Renderizar la vista
protected.Get("/loadmodules", controllers.GetModules) // Obtener todos los módulos
protected.Post("/modules", controllers.CreateModule) // Crear un nuevo módulo
protected.Get("/dashboard", middlewares.MenuMiddleware, controllers.Dashboard)
protected.Put("/modules/:id", controllers.UpdateModule) // Actualizar un módulo existente
protected.Delete("/modules/:id", controllers.DeleteModule) // Eliminar un módulo