Commit Graph

120 Commits

Author SHA1 Message Date
ffcc340034 remove flash from layout. 2025-10-28 13:49:55 +00:00
af581a4def Fix ob: type not registered for interface: map[string]string & superfluous response.WriteHeader, as well as wired up to go to custom 500 messages. 2025-10-28 13:16:29 +00:00
e0b063fab0 Remove comments and update path. 2025-10-28 12:43:41 +00:00
4a6bfad880 readme file. 2025-10-28 12:01:52 +00:00
04c3cb3851 Current config structure 2025-10-28 11:59:04 +00:00
c911bf9151 Ignore main.exe 2025-10-28 11:57:27 +00:00
86be6479f1 Stack of changes to get gin, scs, nosurf running. 2025-10-28 11:56:42 +00:00
07117ba35e No longer required. 2025-10-24 13:19:55 +01:00
ac1f6e9399 refactor(template): delegate handler-level RenderError to helpers package
- Moved core RenderError logic to internal/helpers/template/error.go
- Added thin wrapper method in internal/handlers/template/error.go
- Simplified function signature (no config args, uses InitSiteMeta)
- Preserved architecture: handlers own HTTP layer, helpers supply logic
2025-10-24 13:15:12 +01:00
fb07c4a5eb Refactoring for Gin, NoSurf and SCS continues. 2025-10-24 13:08:53 +01:00
7276903733 refactor(config): move Config struct from business layer to platform/config
Moved the Config struct (previously in internal/models/config.go) into internal/platform/config/types.go to align with clean architecture principles.

This change decouples runtime/infrastructure configuration from domain models:
- Configuration is an application/platform concern, not part of the business domain.
- Prevents potential circular imports between models and platform packages.
- Simplifies future integration with platform components (SCS sessions, CSRF, DB).

No functional changes to configuration loading structure and JSON schema remain the same; only the package location and imports were updated.
2025-10-24 08:35:39 +01:00
0f60be448d Refactoring continues. 2025-10-23 21:51:15 +01:00
82f457c5a4 New packages for MySQL. 2025-10-23 19:53:06 +01:00
b098915ab9 Update import paths 2025-10-23 19:51:28 +01:00
21ebc9c34b Refactor and remove sqlite and replace with MySQL 2025-10-23 18:43:31 +01:00
d53e27eea8 Switching to MySQL 2025-10-22 22:43:35 +01:00
752db0b89d New statistics related models and handlers. 2025-10-22 20:58:25 +01:00
8d06a7a962 Remove log output and updated comment 2025-10-22 20:57:03 +01:00
7597fff8b1 routes.SetupStatisticsRoutes 2025-10-22 20:56:04 +01:00
58dd313703 Forgot to add draw IDs to tables. 2025-10-20 14:48:33 +01:00
e0a2e5430e Change greeting to include user related dropdown items. 2025-04-23 15:30:23 +01:00
7d26f6cf48 Update footer so copyright start year is displayed and evaluated. 2025-04-23 15:30:02 +01:00
0634876b75 Add in context to dashboard for user to topbar loads all items & refactor for clarity of variable extraction. 2025-04-23 15:29:34 +01:00
b5f1b17684 Fix loading of tickets missing range class. 2025-04-23 11:54:45 +01:00
f9853c921d Refactoring finalised ... I think. 2025-04-23 11:30:03 +01:00
e938828a8c fix loading ofr login form and redirects. 2025-04-23 10:06:55 +01:00
2ce810a4dd Refactoring cont. 2025-04-23 09:44:19 +01:00
5c3a847900 Massive refactor! 2025-04-22 23:26:11 +01:00
05bb05d45c Move admin.go this is a storage task, updated routes to use proection 2025-04-16 10:41:06 +01:00
7f91771166 Implement a stronger, reusable session timeout 2025-04-16 10:32:34 +01:00
f7e9fe7794 make shutting down graceful 2025-04-16 10:24:54 +01:00
2440b3a668 Rewiring CSRF protection and movign some functionality to the bootstrapping stage. 2025-04-16 09:50:58 +01:00
4bb3b58ddb Bootstrapped the creation and loading of session keys to lighten main. 2025-04-16 08:21:02 +01:00
0a21973237 rework to lighten the main, refactor wrappers. Rehandle csrf and pull config items. 2025-04-15 22:19:55 +01:00
0a5d61ea1e Re-work loading of configuration, introduce a loader for start up & and custom logging wrapper. 2025-04-15 21:10:57 +01:00
d7c15141b8 Been too long since i did anything, can't remember what the hell is in all this.... 2025-04-15 20:56:21 +01:00
152c5cb18c Add Syndicate Invite Token System (Secure Links)
- Added route + handler: GenerateInviteLinkHandler to create signed tokens
- Added handler: JoinSyndicateWithTokenHandler to join using invite token
- Integrated secure token generation via helpers.GenerateSecureToken()
- Created DB model: syndicate_invite_tokens (assumed pre-existing)
- Updated syndicate view template to allow managers to generate links
- Flash messaging for invite success/failure
- Invite links are scoped to manager role and valid for 48 hours
2025-04-04 22:33:40 +01:00
8b02a3137d Filter out syndicates where the user is both the owner and a member in syndicate veiw. 2025-04-04 11:19:45 +01:00
f6350b1d7f more link fixes. 2025-04-04 11:12:54 +01:00
292db01011 Fix issue creating syndicates, accepted should not be set when creating. 2025-04-04 11:10:15 +01:00
02300c69d8 Fix Syndicate paths. 2025-04-04 10:57:06 +01:00
22fbf59157 Forgot to remove handler. 2025-04-04 10:30:28 +01:00
ef4478e8a6 Added syndicate creation and invite logic
- Implemented `CreateSyndicate` with transaction support
- Added `InviteToSyndicate` with membership check and invite insert
- Created syndicate invite model and DB logic for accepting/declining
- Ensured consistent error handling with `fmt.Errorf`
- Cleaned up unused invite handlers/routes
2025-04-04 10:26:24 +01:00
df6608dda5 forgot to stage 2025-04-02 23:53:40 +01:00
053ccf3845 **Untested! ** Add restore functionality for archived messages
- Added `RestoreMessageHandler` and route at `/account/messages/restore`
- Updated `users_messages` table to support `archived_at` reset
- Added restore button to archived messages template
- Ensures archived messages can be moved back into inbox
2025-04-02 23:53:29 +01:00
db5352bc9c Add restore functionality for archived messages
- Added `RestoreMessageHandler` and route at `/account/messages/restore`
- Updated `users_messages` table to support `archived_at` reset
- Added restore button to archived messages template
- Ensures archived messages can be moved back into inbox
2025-04-02 22:18:02 +01:00
dd83081271 Added full message handling system with archive view, pagination, and send support
- Implemented message inbox and archived messages view
- Added pagination logic to both inbox and archive handlers
- Integrated message sending functionality with CSRF protection
- Updated schema to include `archived_at` timestamp
- Included archive button and logic with feedback flash messaging
- Fixed message dropdown routing and rendering in topbar
- Cleaned up template load paths and error handling
2025-04-02 21:29:54 +01:00
e3428911b9 Messages: Add archive (soft-delete) support + dropdown UI polish
- Implemented `/account/messages/archive` route for soft-archiving messages
- Added `is_archived` flag to `users_messages` schema and model
- Topbar dropdown now reflects accurate unread message count
- Fixed missing route registration for archive handler
- Improved message visibility checks to prevent access violations
- Placeholder for rate-limit (429) error page rendering identified
2025-04-02 17:15:57 +01:00
2fd053777d Feature: complete message inbox, view, and topbar integration
Added users_messages schema with correct field naming (senderId, recipientId)

Implemented message count and recent message fetch via storage.GetMessageCount and GetRecentMessages

Fixed field mismatches in SQL queries (recipientId vs recipient_id)

Displayed unread message badge in topbar with truncation for body preview

Linked messages in dropdown to full view (/account/messages/read?id=...)

Added fallback handling for unauthorized/invalid message access

Cleaned up BuildTemplateData to support full message context

Ensured CSRF/session/user context remains intact throughout
2025-04-02 13:41:51 +01:00
b630296b8c Add message system (inbox, read view, dropdown) and truncate helper
Implemented message retrieval and read logic in storage layer

Added handlers for inbox and individual message view

Integrated messages into topbar dropdown with unread badge

Added truncate helper to template functions

Created new templates: messages/index.html and messages/read.html

Fixed missing template function error in topbar rendering
2025-04-02 11:56:11 +01:00