2022-05-20 16:13:46 +00:00
|
|
|
{{ define "body" }}
|
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
{{ if gt (len .Payload.Tags) 0 }}
|
|
|
|
<p>
|
|
|
|
Existing tags:
|
|
|
|
<em>
|
|
|
|
{{ range $i, $tag := .Payload.Tags }}
|
|
|
|
{{ if ne $i 0 }} {{ end }}{{ $tag }}
|
|
|
|
{{ end }}
|
|
|
|
</em>
|
|
|
|
</p>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
<form method="POST" action="{{ BlogURL "posts/" }}">
|
2022-05-20 16:13:46 +00:00
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
<table>
|
2022-05-20 16:13:46 +00:00
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
Unique ID
|
|
|
|
</td>
|
|
|
|
<td>
|
2022-05-21 17:20:45 +00:00
|
|
|
{{ if eq .Payload.Post.ID "" }}
|
2022-08-17 03:32:50 +00:00
|
|
|
<input
|
|
|
|
name="id"
|
|
|
|
type="text"
|
|
|
|
placeholder="e.g. how-to-fly-a-kite"
|
|
|
|
value="{{ .Payload.Post.ID }}" />
|
2022-05-20 16:47:22 +00:00
|
|
|
{{ else }}
|
2022-08-17 03:32:50 +00:00
|
|
|
<a href="{{ PostURL .Payload.Post.ID }}" target="_blank">{{ .Payload.Post.ID }}</a>
|
|
|
|
<input name="id" type="hidden" value="{{ .Payload.Post.ID }}" />
|
2022-05-20 16:47:22 +00:00
|
|
|
{{ end }}
|
2022-08-17 03:32:50 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<p>Tags (space separated)</p>
|
|
|
|
</td>
|
|
|
|
<td>
|
2022-05-20 16:13:46 +00:00
|
|
|
<input
|
|
|
|
name="tags"
|
|
|
|
type="text"
|
2022-08-17 03:32:50 +00:00
|
|
|
value="{{- range $i, $tag := .Payload.Post.Tags -}}
|
|
|
|
{{- if ne $i 0 }} {{ end }}{{ $tag -}}
|
|
|
|
{{- end -}}
|
|
|
|
"/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Series</td>
|
|
|
|
<td>
|
2022-05-20 16:13:46 +00:00
|
|
|
<input
|
|
|
|
name="series"
|
|
|
|
type="text"
|
2022-05-21 17:20:45 +00:00
|
|
|
value="{{ .Payload.Post.Series }}" />
|
2022-08-17 03:32:50 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2022-05-20 16:13:46 +00:00
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
<tr>
|
|
|
|
<td>Title</td>
|
|
|
|
<td>
|
2022-05-20 16:13:46 +00:00
|
|
|
<input
|
|
|
|
name="title"
|
|
|
|
type="text"
|
2022-05-21 17:20:45 +00:00
|
|
|
value="{{ .Payload.Post.Title }}" />
|
2022-08-17 03:32:50 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
2022-05-20 16:13:46 +00:00
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
<tr>
|
|
|
|
<td>Description</td>
|
|
|
|
<td>
|
2022-05-20 16:13:46 +00:00
|
|
|
<input
|
|
|
|
name="description"
|
|
|
|
type="text"
|
2022-05-21 17:20:45 +00:00
|
|
|
value="{{ .Payload.Post.Description }}" />
|
2022-08-17 03:32:50 +00:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<textarea
|
|
|
|
name="body"
|
|
|
|
placeholder="Blog body"
|
|
|
|
style="width:100%;height: 75vh;"
|
|
|
|
>
|
|
|
|
{{- .Payload.Post.Body -}}
|
|
|
|
</textarea>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2022-05-20 17:06:21 +00:00
|
|
|
<input
|
|
|
|
type="submit"
|
|
|
|
value="Preview"
|
2022-05-21 17:20:45 +00:00
|
|
|
formaction="{{ BlogURL "posts/" }}{{ .Payload.Post.ID }}?method=preview"
|
2022-05-20 17:06:21 +00:00
|
|
|
formtarget="_blank"
|
|
|
|
/>
|
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
{{ if eq .Payload.Post.ID "" }}
|
|
|
|
<input type="submit" value="Publish" formaction="{{ BlogURL "posts/" }}" />
|
|
|
|
{{ else }}
|
|
|
|
<input type="submit" value="Update" formaction="{{ BlogURL "posts/" }}" />
|
|
|
|
{{ end }}
|
2022-05-20 17:06:21 +00:00
|
|
|
|
|
|
|
<a href="{{ BlogURL "posts/" }}">
|
2022-08-17 03:32:50 +00:00
|
|
|
<button type="button">Back</button>
|
2022-05-20 17:06:21 +00:00
|
|
|
</a>
|
2022-08-17 03:32:50 +00:00
|
|
|
</p>
|
2022-05-20 16:13:46 +00:00
|
|
|
|
2022-08-17 03:32:50 +00:00
|
|
|
</form>
|
2022-05-20 16:13:46 +00:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ template "base.html" . }}
|