Styled the admin section of categories.

This commit is contained in:
Leon Mika 2026-03-21 12:01:24 +11:00
parent 740cf8979a
commit f45bdcd83c
8 changed files with 78 additions and 56 deletions

View file

@ -1,6 +1,6 @@
{{ $isPublished := ne .post.State 1 }}
<main class="flex-grow-1 position-relative">
<form action="/sites/{{.site.ID}}/posts" method="post" class="container-fluid post-form p-2"
<form action="/sites/{{.site.ID}}/posts" method="post" class="container-fluid post-form py-2"
data-controller="postedit"
data-action="keydown.meta+s->postedit#save keydown.meta+enter->postedit#publish"
data-postedit-save-action-value="{{ if $isPublished }}Update{{ else }}Save Draft{{ end }}">
@ -10,9 +10,7 @@
<div class="mb-2">
<input type="text" name="title" class="form-control" placeholder="Title" value="{{ .post.Title }}">
</div>
<div>
<textarea data-postedit-target="bodyTextEdit" name="body" class="form-control" rows="3">{{.post.Body}}</textarea>
</div>
<textarea data-postedit-target="bodyTextEdit" name="body" class="form-control flex-grow-1" rows="3">{{.post.Body}}</textarea>
<div>
{{ if $isPublished }}
<input type="submit" name="action" class="btn btn-primary mt-2" value="Update">

View file

@ -28,12 +28,9 @@
<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>
<span class="text-muted post-date">{{ $.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 $p.PublishedAt }}</span>
{{ end }}
{{ range $p.Categories }}
<span class="ms-1 badge bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle">{{ .Name }}</span>
<span class="text-muted post-date">{{ $.user.FormatTime $p.PublishedAt }}</span>
{{ end }}
</div>