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 | |
parent | 33a81f73e1ba59e76cf94c4439b80176cbb8261f (diff) |
implemented draft publishing and removed New Posts link/capability
Diffstat (limited to 'srv/src/http/tpl')
-rw-r--r-- | srv/src/http/tpl/edit-post.html | 20 | ||||
-rw-r--r-- | srv/src/http/tpl/posts.html | 6 |
2 files changed, 18 insertions, 8 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 }} diff --git a/srv/src/http/tpl/posts.html b/srv/src/http/tpl/posts.html index 946c713..5f75168 100644 --- a/srv/src/http/tpl/posts.html +++ b/srv/src/http/tpl/posts.html @@ -2,12 +2,6 @@ <h1>Posts</h1> - <p> - <a href="{{ BlogURL "posts/" }}?edit"> - New Post - </a> - </p> - {{ if ge .Payload.PrevPage 0 }} <p> <a href="?p={{ .Payload.PrevPage}}">< < Previous Page</a> |