feat: add category selection to post edit form and badges to post list

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Leon Mika 2026-03-18 21:45:28 +11:00
parent ffa86b12e9
commit 4c2ce7272d
6 changed files with 112 additions and 30 deletions

View file

@ -26,11 +26,14 @@
{{ if $p.Title }}<h4 class="mb-3">{{ $p.Title }}</h4>{{ end }}
{{ markdown $p.Body $.site }}
<div class="mb-3 d-flex align-items-center">
{{ if eq .State 1 }}
<span class="text-muted">{{ $.user.FormatTime .UpdatedAt }}</span> <span class="ms-3 badge text-primary-emphasis bg-primary-subtle border border-primary-subtle">Draft</span>
<div class="mb-3 d-flex align-items-center flex-wrap gap-1">
{{ if eq $p.State 1 }}
<span class="text-muted">{{ $.user.FormatTime $p.UpdatedAt }}</span> <span class="ms-3 badge text-primary-emphasis bg-primary-subtle border border-primary-subtle">Draft</span>
{{ else }}
<span class="text-muted">{{ $.user.FormatTime .PublishedAt }}</span>
<span class="text-muted">{{ $.user.FormatTime $p.PublishedAt }}</span>
{{ end }}
{{ range $p.Categories }}
<span class="ms-1 badge bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle">{{ .Name }}</span>
{{ end }}
</div>