From 3140d9e1430d52ed37b29af07599c5d7a58e9ef4 Mon Sep 17 00:00:00 2001 From: StarFleetCPTN Date: Sun, 23 Mar 2025 09:54:06 -0700 Subject: [PATCH] feat: Enhance notifications and pagination functionality - Implemented pagination for user notifications, allowing users to navigate through their notifications more efficiently. - Updated the notifications page to display the total count of notifications and provide controls for adjusting the number of notifications shown per page. - Added backend support for fetching paginated notifications and counting total notifications for users. - Improved the user interface for notifications, including a new layout and additional help sections to guide users on managing their notifications. --- components/admin_database.templ | 4 +- components/dashboard.templ | 6 +- components/layout.templ | 164 +++--- components/notification_page.templ | 365 ++++++++++--- components/notifications.templ | 5 + components/settings.templ | 502 ++++++----------- internal/db/user_notification.go | 14 + internal/web/handlers/database_handlers.go | 441 ++++++++++----- .../web/handlers/notifications_handlers.go | 57 +- internal/web/handlers/routes.go | 14 +- internal/web/handlers/user_handlers.go | 510 +++++++++--------- 11 files changed, 1187 insertions(+), 895 deletions(-) diff --git a/components/admin_database.templ b/components/admin_database.templ index 81e4f4a..85ec15f 100644 --- a/components/admin_database.templ +++ b/components/admin_database.templ @@ -81,11 +81,11 @@ templ AdminDatabaseTools(ctx context.Context, backups []BackupFile) {

Export system configurations and jobs for backup or migration.

- + Export Configs - + Export Jobs diff --git a/components/dashboard.templ b/components/dashboard.templ index 278fa3a..2d00182 100644 --- a/components/dashboard.templ +++ b/components/dashboard.templ @@ -147,15 +147,15 @@ templ Dashboard(ctx context.Context, data DashboardData) {
if job.Status == "completed" { - + } else if job.Status == "failed" { - + } else { - + } diff --git a/components/layout.templ b/components/layout.templ index 7222fac..4eb6cc4 100644 --- a/components/layout.templ +++ b/components/layout.templ @@ -2,13 +2,13 @@ package components import ( "context" + "fmt" "github.com/gin-gonic/gin" "time" - "fmt" ) // AppVersion will be set at build time using ldflags -// Example build command: +// Example build command: // go build -ldflags "-X github.com/starfleetcptn/gomft/components.AppVersion=1.2.3" var AppVersion = "dev" @@ -48,22 +48,22 @@ templ LayoutWithContext(title string, ctx context.Context) { - - - - + + + + { title } - GoMFT - + - + - +