diff options
author | Brian Picciano <mediocregopher@gmail.com> | 2022-08-19 21:47:38 -0600 |
---|---|---|
committer | Brian Picciano <mediocregopher@gmail.com> | 2022-08-19 21:47:38 -0600 |
commit | f365b0975778984281b69d66150ee2d026e2613b (patch) | |
tree | e16022ab67413f96538cb720065264f73f562cb0 /srv/src/http/tpl/edit-post.html | |
parent | 33a81f73e1ba59e76cf94c4439b80176cbb8261f (diff) |
implemented draft publishing and removed New Posts link/capability
Diffstat (limited to 'srv/src/http/tpl/edit-post.html')
-rw-r--r-- | srv/src/http/tpl/edit-post.html | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/srv/src/http/tpl/edit-post.html b/srv/src/http/tpl/edit-post.html index ea1f2c1..ea07680 100644 --- a/srv/src/http/tpl/edit-post.html +++ b/srv/src/http/tpl/edit-post.html @@ -90,6 +90,7 @@ </p> <p> + <input type="submit" value="Preview" @@ -99,8 +100,23 @@ {{ if .Payload.IsDraft }} <input type="submit" value="Save" formaction="{{ BlogURL "drafts/" }}" /> - {{ else if eq .Payload.Post.ID "" }} - <input type="submit" value="Publish" formaction="{{ BlogURL "posts/" }}" /> + + + <script> + function confirmPublish(event) { + if (!confirm("Are you sure you're ready to publish?")) + event.preventDefault(); + } + </script> + + + <input + type="submit" + value="Publish" + formaction="{{ BlogURL "posts/" }}" + onclick="confirmPublish(event)" + /> + {{ else }} <input type="submit" value="Update" formaction="{{ BlogURL "posts/" }}" /> {{ end }} |