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
This commit is contained in:
2025-04-02 11:56:11 +01:00
parent ab1d9abc72
commit b630296b8c
9 changed files with 186 additions and 38 deletions

View File

@@ -114,8 +114,9 @@ CREATE TABLE IF NOT EXISTS my_tickets (
const SchemaUsersMessages = `
CREATE TABLE IF NOT EXISTS users_messages (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL REFERENCES users(id),
title TEXT NOT NULL,
senderId INTEGER NOT NULL REFERENCES users(id),
recipientId int,
subject TEXT NOT NULL,
message TEXT,
is_read BOOLEAN DEFAULT FALSE,
type VARCHAR(50),