Commit Graph

32 Commits

Author SHA1 Message Date
b5f1b17684 Fix loading of tickets missing range class. 2025-04-23 11:54:45 +01:00
2ce810a4dd Refactoring cont. 2025-04-23 09:44:19 +01:00
5c3a847900 Massive refactor! 2025-04-22 23:26:11 +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
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
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
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
ab1d9abc72 Refactor: Recover middleware now uses RenderError + add full notifications view
- Replaced http.Error with helpers.RenderError in Recover middleware
- Custom 500.html now rendered with layout and topbar on panic
- RenderError gracefully checks template existence and falls back to plain response
- Added /account/notifications full view page (index)
- Linked "Back to notifications" from notification read view
- Fixed typo in template path for notifications/index.html
- Improved layout consistency across error and account pages
2025-04-02 09:54:20 +01:00
2498b33a9c Refactor: Centralize template loading and improve error handling
- Introduced helpers.LoadTemplateFiles() for consistent layout + topbar rendering
- Replaced repeated template.ParseFiles() calls across handlers
- Created generic RenderError(w, r, statusCode) helper
- Replaced old Render403 with flexible RenderError
- Updated AdminOnly middleware to render 403 errors with context
- Added 500.html template for graceful panic fallback
- Prepared structure for future error codes (404, 429, etc.)
2025-04-02 09:12:13 +01:00
5ea780fcab Cleanup: Finalize template context integration and remove legacy code
- Replaced legacy TemplateContext calls with structured TemplateData usage
- Removed unused variables and redundant storage calls in notifications handler
- Ensured consistent use of BuildTemplateData across user-facing handlers
- Resolved all compile-time errors from refactor
- Ready for runtime testing and further layout integration
2025-04-01 21:20:05 +01:00
03b1e095ce Refactor: Centralize template context using unified TemplateData struct
- Introduced models.TemplateData for shared user/context state
- Moved context construction logic into handlers/template_context.go
- Simplified helpers.TemplateContext to accept structured data
- Restored and organized template helper functions
- Updated affected handlers (main.go, draw_handler.go, notifications.go)
- Improved scalability and separation of concerns in template rendering
2025-04-01 21:08:00 +01:00
0e20cc023c more changes but unsure of state had to trash last set fof changes and try repair. 2025-04-01 15:50:15 +01:00
aaf90b55da Lots of UI and admin changes, need to clean up the three audit log tables and a few other niggles. 2025-04-01 00:05:48 +01:00
7eefb9ced0 Additional security and hardening. 2025-03-31 15:14:16 +01:00
f8dab97a54 Working through issue where prizes are incorrect and need updating. 2025-03-29 15:42:14 +00:00
0d33d65844 finalise ball colourings and display 2025-03-28 15:20:56 +00:00
75d8d1700e updated so balls are coloured to their respective game. need to thing about set for life. 2025-03-28 14:52:50 +00:00
cabc283673 madness continues 2025-03-28 13:04:53 +00:00
23e0208317 Lots of changes around viewing tickets from css perspective logic changes nwe handlers and service triggers... just lots of stuff... 2025-03-28 10:05:54 +00:00
f7b54db7c1 Get ticket functionality. 2025-03-26 15:33:40 +00:00
9df4b173fb remove println 2025-03-26 09:43:01 +00:00
8dc4f61089 new helper for adding tickets 2025-03-26 09:41:39 +00:00
e3f3d73fdd Finally get login working. 2025-03-26 08:36:11 +00:00
11f031ff54 AuThEnTiCaTiOn and clean up.... 2025-03-25 21:39:48 +00:00
b58a8bdb82 Circular dependancy issue when working on hardening 2025-03-25 16:43:16 +00:00
1a531af4f8 implement rate limiting 2025-03-25 15:12:56 +00:00
0b93fd75dd add and refine thunderball results page 2025-03-25 14:47:41 +00:00
d2013ec5c5 Lots of changes and fixes 2025-03-24 23:23:29 +00:00
09b2ad8c56 Bonus Fields Need *int not any 2025-03-24 23:06:00 +00:00