aboutsummaryrefslogtreecommitdiffstats
path: root/internal/web/templates/dashboard/post_form.html
diff options
context:
space:
mode:
authorgrm <grm@eyesin.space>2026-09-14 22:58:08 +0300
committergrm <grm@eyesin.space>2026-09-14 22:58:08 +0300
commit5f9fc2a8667a9438b6336d75026f9a455fc9c4ce (patch)
tree8fa0009b2487e35219bfdbb34f9802704007076e /internal/web/templates/dashboard/post_form.html
parente14a4250efb828262347f5a4bbc4067cd71d885f (diff)
downloadblogspace-5f9fc2a8667a9438b6336d75026f9a455fc9c4ce.tar.gz
blogspace-5f9fc2a8667a9438b6336d75026f9a455fc9c4ce.tar.bz2
blogspace-5f9fc2a8667a9438b6336d75026f9a455fc9c4ce.zip
Let the blogger set a post's date, when writing it and afterwards
The post date is posts.created_at: it already drives ordering, the archive, the feed and the displayed dates, so making it editable is a form field rather than a new column. The datetime-local input degrades to a text box on old browsers, so the server also accepts the value typed by hand; blank keeps the current date. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sd8UPWrvyYCLj97JexNw3A
Diffstat (limited to 'internal/web/templates/dashboard/post_form.html')
-rw-r--r--internal/web/templates/dashboard/post_form.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/web/templates/dashboard/post_form.html b/internal/web/templates/dashboard/post_form.html
index af48215..8069a9a 100644
--- a/internal/web/templates/dashboard/post_form.html
+++ b/internal/web/templates/dashboard/post_form.html
@@ -11,6 +11,8 @@
</label>
<label>{{t "Address"}} <span class="muted">({{t "optional, made from the title"}})</span><br>
<input name="slug" value="{{.Data.post.Slug}}" pattern="[a-z0-9]([a-z0-9-]*[a-z0-9])?" maxlength="80"></label>
+ <label>{{t "Date"}}<br>
+ <input type="datetime-local" name="posted_at" value="{{.Data.post.CreatedAt.Format "2006-01-02T15:04"}}" placeholder="YYYY-MM-DD HH:MM"></label>
</div>
<label for="ed-body">{{t "Content"}} <span class="muted">(Markdown)</span></label>
{{template "editor" (dict "name" "body" "value" .Data.post.BodyMD "rows" 24 "tall" true "upload" (print "/b/" .Blog.Subdomain "/images/upload") "csrf" .CSRF)}}