2026-02-24 11:21:26 +00:00
|
|
|
{{ $isPublished := ne .post.State 1 }}
|
2026-02-20 23:22:10 +00:00
|
|
|
<main class="flex-grow-1 position-relative">
|
2026-03-21 01:01:24 +00:00
|
|
|
<form action="/sites/{{.site.ID}}/posts" method="post" class="container-fluid post-form py-2"
|
2026-02-24 11:21:26 +00:00
|
|
|
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 }}">
|
2026-03-18 10:45:28 +00:00
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-9">
|
|
|
|
|
<input type="hidden" name="guid" value="{{ .post.GUID }}">
|
|
|
|
|
<div class="mb-2">
|
|
|
|
|
<input type="text" name="title" class="form-control" placeholder="Title" value="{{ .post.Title }}">
|
|
|
|
|
</div>
|
2026-03-21 01:01:24 +00:00
|
|
|
<textarea data-postedit-target="bodyTextEdit" name="body" class="form-control flex-grow-1" rows="3">{{.post.Body}}</textarea>
|
2026-03-23 10:48:43 +00:00
|
|
|
<div class="mt-2">
|
2026-03-18 10:45:28 +00:00
|
|
|
{{ if $isPublished }}
|
2026-03-23 10:48:43 +00:00
|
|
|
<input type="submit" name="action" class="btn btn-primary" value="Update">
|
2026-03-18 10:45:28 +00:00
|
|
|
{{ else }}
|
2026-03-23 10:48:43 +00:00
|
|
|
<input type="submit" name="action" class="btn btn-primary" value="Publish">
|
|
|
|
|
<input type="submit" name="action" class="btn btn-secondary" value="Save Draft">
|
2026-03-18 10:45:28 +00:00
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="col-md-3">
|
|
|
|
|
<div class="card">
|
|
|
|
|
<div class="card-header">Categories</div>
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
{{ range .categories }}
|
|
|
|
|
<div class="form-check">
|
|
|
|
|
<input class="form-check-input" type="checkbox" name="category_ids"
|
|
|
|
|
value="{{ .ID }}" id="cat-{{ .ID }}"
|
|
|
|
|
{{ if index $.selectedCategories .ID }}checked{{ end }}>
|
|
|
|
|
<label class="form-check-label" for="cat-{{ .ID }}">{{ .Name }}</label>
|
|
|
|
|
</div>
|
|
|
|
|
{{ else }}
|
|
|
|
|
<span class="text-muted">No categories yet.</span>
|
|
|
|
|
{{ end }}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2026-02-20 23:22:10 +00:00
|
|
|
</div>
|
|
|
|
|
</form>
|
2026-03-18 10:45:28 +00:00
|
|
|
</main>
|