summaryrefslogtreecommitdiff
path: root/srv/src/http/tpl/edit-post.html
diff options
context:
space:
mode:
authorBrian Picciano <mediocregopher@gmail.com>2022-05-20 11:17:31 -0600
committerBrian Picciano <mediocregopher@gmail.com>2022-05-20 11:17:31 -0600
commit09acb111a2b22f5794541fac175b024dd0f9100e (patch)
tree11d4578a42ad4aea968b42a2689f64c799f9176e /srv/src/http/tpl/edit-post.html
parentf69ed83de73bbfc4b7af0931de6ced8cf12dea61 (diff)
Rename api package to http
Diffstat (limited to 'srv/src/http/tpl/edit-post.html')
-rw-r--r--srv/src/http/tpl/edit-post.html101
1 files changed, 101 insertions, 0 deletions
diff --git a/srv/src/http/tpl/edit-post.html b/srv/src/http/tpl/edit-post.html
new file mode 100644
index 0000000..9ccfa2a
--- /dev/null
+++ b/srv/src/http/tpl/edit-post.html
@@ -0,0 +1,101 @@
+{{ define "body" }}
+
+ <form method="POST" action="{{ BlogURL "posts/" }}">
+
+ {{ .CSRFFormInput }}
+
+ <div class="row">
+
+ <div class="columns six">
+ <label for="idInput">Unique ID</label>
+ {{ if eq .Payload.ID "" }}
+ <input
+ id="idInput"
+ name="id"
+ class="u-full-width"
+ type="text"
+ placeholder="e.g. how-to-fly-a-kite"
+ value="{{ .Payload.ID }}" />
+ {{ else }}
+ <a href="{{ PostURL .Payload.ID }}" target="_blank">{{ .Payload.ID }}</a>
+ <input name="id" type="hidden" value="{{ .Payload.ID }}" />
+ {{ end }}
+ </div>
+
+ <div class="columns three">
+ <label for="tagsInput">Tags (space separated)</label>
+ <input
+ id="tagsInput"
+ name="tags"
+ class="u-full-width"
+ type="text"
+ value="{{ range $i, $tag := .Payload.Tags }}{{ if ne $i 0 }} {{ end }}{{ $tag }}{{ end }}" />
+ </div>
+
+ <div class="columns three">
+ <label for="seriesInput">Series</label>
+ <input
+ id="seriesInput"
+ name="series"
+ class="u-full-width"
+ type="text"
+ value="{{ .Payload.Series }}" />
+ </div>
+
+ </div>
+
+ <div class="row">
+
+ <div class="columns six">
+ <label for="titleInput">Title</label>
+ <input
+ id="titleInput"
+ name="title"
+ class="u-full-width"
+ type="text"
+ value="{{ .Payload.Title }}" />
+ </div>
+
+ <div class="columns six">
+ <label for="descrInput">Description</label>
+ <input
+ id="descrInput"
+ name="description"
+ class="u-full-width"
+ type="text"
+ value="{{ .Payload.Description }}" />
+ </div>
+
+ </div>
+
+ <div class="row">
+ <div class="columns twelve">
+ <textarea
+ name="body"
+ class="u-full-width"
+ placeholder="Blog body"
+ style="height: 50vh;"
+ >
+ {{- .Payload.Body -}}
+ </textarea>
+ </div>
+ </div>
+
+ <input
+ type="submit"
+ value="Preview"
+ formaction="{{ BlogURL "posts/" }}{{ .Payload.ID }}?method=preview"
+ formtarget="_blank"
+ />
+
+ <input type="submit" value="Save" formaction="{{ BlogURL "posts/" }}" />
+
+ <a href="{{ BlogURL "posts/" }}">
+ <button type="button">Cancel</button>
+ </a>
+
+ </form>
+
+{{ end }}
+
+{{ template "base.html" . }}