Fix archiving and unarchiving functionality.

This commit is contained in:
2025-11-01 22:37:47 +00:00
parent 9dc01f925a
commit 61ad033520
8 changed files with 88 additions and 32 deletions

View File

@@ -11,7 +11,7 @@
<p class="card-text">
<small class="text-muted">
Archived:
{{ if .ArchivedAt.Valid }}
{{ with .ArchivedAt }}
{{ .Format "02 Jan 2006 15:04" }}
{{ else }}
@@ -28,20 +28,20 @@
{{ end }}
<!-- Pagination Controls (keep if your funcs exist) -->
<nav>
<ul class="pagination">
{{ if gt .Page 1 }}
<nav>
<ul class="pagination">
{{ if gt .CurrentPage 1 }}
<li class="page-item">
<a class="page-link" href="?page={{ minus1 .Page }}">Previous</a>
<a class="page-link" href="?page={{ sub .CurrentPage 1 }}">Previous</a>
</li>
{{ end }}
{{ if .HasMore }}
{{ end }}
{{ if lt .CurrentPage .TotalPages }}
<li class="page-item">
<a class="page-link" href="?page={{ plus1 .Page }}">Next</a>
<a class="page-link" href="?page={{ add .CurrentPage 1 }}">Next</a>
</li>
{{ end }}
</ul>
</nav>
{{ end }}
</ul>
</nav>
{{ else }}
<div class="alert alert-info text-center">No archived messages.</div>
{{ end }}

View File

@@ -7,7 +7,7 @@
{{ range .Messages }}
<li class="list-group-item d-flex justify-content-between align-items-center">
<div>
<a href="/account/messages/read?={{ .ID }}" class="fw-bold text-dark">{{ .Subject }}</a><br>
<a href="/account/messages/read?id={{ .ID }}" class="fw-bold text-dark">{{ .Subject }}</a><br>
<small class="text-muted">{{ .CreatedAt.Format "02 Jan 2006 15:04" }}</small>
</div>
<form method="POST" action="/account/messages/archive" class="m-0">