From 151ddc6f63a033efa4730fd46aab840c40b5702d Mon Sep 17 00:00:00 2001 From: cclohmar Date: Mon, 15 Jun 2026 19:53:37 +0000 Subject: [PATCH] fix(apps): 4 tiles clickable (Admin + WorkSheets/TypeWriter/DeckCreator/NotesFiles) --- src/core/ui/app-grid.templ.bak | 121 +++++++++++++++++++++++++++++++++ src/core/ui/app-grid_templ.go | 2 +- 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 src/core/ui/app-grid.templ.bak diff --git a/src/core/ui/app-grid.templ.bak b/src/core/ui/app-grid.templ.bak new file mode 100644 index 0000000..da441bf --- /dev/null +++ b/src/core/ui/app-grid.templ.bak @@ -0,0 +1,121 @@ +package ui + +// AppTile represents an app on the workspace launcher. +type AppTile struct { + Name string + Description string + URL string + Icon string // SVG inline + Color string // Background color + Status string // "ready" or "coming-soon" + AdminOnly bool // Only visible to admin role +} + +// DefaultApps returns apps filtered by user role. +func DefaultApps(role string) []AppTile { + all := []AppTile{ + { + Name: "Admin Panel", Description: "Users, groups & settings", + URL: "/admin", Color: "#9333ea", + Icon: ``, + Status: "ready", AdminOnly: true, + }, + { + Name: "Files", Description: "Storage & sharing", + URL: "#", Color: "#2563eb", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "Mail", Description: "Email client", + URL: "#", Color: "#dc2626", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "Calendar", Description: "Schedule & events", + URL: "#", Color: "#059669", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "WorkSheets", Description: "Spreadsheets", + URL: "/worksheets", Color: "#059669", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "TypeWriter", Description: "Documents", + URL: "/typewriter", Color: "#2563eb", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "DeckCreator", Description: "Presentations", + URL: "/deckcreator", Color: "#dc2626", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "NotesFiles", Description: "Notes & files", + URL: "/notesfiles", Color: "#d97706", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "Contacts", Description: "People & directory", + URL: "#", Color: "#d97706", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "Tasks", Description: "Project management", + URL: "#", Color: "#7c3aed", + Icon: ``, + Status: "coming-soon", + }, + { + Name: "Chat", Description: "Team messaging", + URL: "#", Color: "#db2777", + Icon: ``, + Status: "coming-soon", + }, + } + + // Filter by role + filtered := make([]AppTile, 0, len(all)) + for _, a := range all { + if a.AdminOnly && role != "admin" { + continue + } + filtered = append(filtered, a) + } + return filtered +} + +templ AppGrid(apps []AppTile) { +
+ for _, a := range apps { + @appTile(a) + } +
+} + +templ appTile(a AppTile) { + if a.Status == "coming-soon" { +
+
@templ.Raw(a.Icon)
+
{ a.Name }
+
Coming Soon
+
+ } else { +
+
@templ.Raw(a.Icon)
+
{ a.Name }
+
Available
+
+ } +} diff --git a/src/core/ui/app-grid_templ.go b/src/core/ui/app-grid_templ.go index d55a73e..ccdb229 100644 --- a/src/core/ui/app-grid_templ.go +++ b/src/core/ui/app-grid_templ.go @@ -161,7 +161,7 @@ func appTile(a AppTile) templ.Component { templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - if a.Status == "coming-soon" { + if a.URL == "#" || a.URL == "" { templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "