From 9c9bd5e881b927d8c9199abceaeb8940f99a847b Mon Sep 17 00:00:00 2001 From: James Date: Tue, 10 Feb 2026 04:00:11 -0500 Subject: [PATCH] Document details: inline category dropdown, formatted processed_at timestamp --- templates/document.html | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/templates/document.html b/templates/document.html index 8b13ae1..c3676a3 100644 --- a/templates/document.html +++ b/templates/document.html @@ -12,12 +12,9 @@
- + + {{categoryIcon .Document.Category}} {{title .Document.Category}} + {{if .Document.Type}} {{title .Document.Type}} @@ -62,6 +59,17 @@
+
+
Category
+
+ +
+
{{if .Document.Date}}
Date
@@ -83,7 +91,7 @@ {{if .Document.ProcessedAt}}
Processed
-
{{formatDate .Document.ProcessedAt}}
+
{{formatDateTime .Document.ProcessedAt}}
{{end}} {{if .Document.OriginalFile}} @@ -380,14 +388,19 @@ document.getElementById('edit-modal').classList.toggle('hidden'); } + const _docMeta = { + id: "{{.Document.ID}}", + title: "{{.Document.Title}}", + notes: "{{.Document.Notes}}" + }; async function inlineUpdateCategory(newCategory) { - const res = await fetch('/api/document/{{.Document.ID}}', { + const res = await fetch('/api/document/' + _docMeta.id, { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({ - title: '{{.Document.Title}}', + title: _docMeta.title, category: newCategory, - notes: `{{.Document.Notes}}` + notes: _docMeta.notes }) }); if (res.ok) {