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
23 lines
722 B
HTML
23 lines
722 B
HTML
{{ define "content" }}
|
|
<div class="container py-4">
|
|
<h2>Your Messages</h2>
|
|
<ul class="list-group mt-3">
|
|
{{ range .Messages }}
|
|
<li class="list-group-item d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<a href="/account/messages/read?id={{ .ID }}" class="{{ if not .IsRead }}fw-bold{{ end }}">
|
|
{{ .Subject }}
|
|
</a>
|
|
<div class="small text-muted">{{ .CreatedAt.Format "02 Jan 2006 15:04" }}</div>
|
|
</div>
|
|
{{ if not .IsRead }}
|
|
<span class="badge bg-primary">Unread</span>
|
|
{{ end }}
|
|
</li>
|
|
{{ else }}
|
|
<li class="list-group-item text-muted text-center">No messages</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|