From c3135306b32e3ee18c3c412fbb2ea81b455201d5 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Thu, 18 Aug 2022 23:07:09 -0600 Subject: drafts functionality added, needs a publish button still --- srv/src/http/tpl/admin.html | 1 + srv/src/http/tpl/draft-posts.html | 48 +++++++++++++++++++++++++++++++++++++++ srv/src/http/tpl/edit-post.html | 10 ++++++++ 3 files changed, 59 insertions(+) create mode 100644 srv/src/http/tpl/draft-posts.html (limited to 'srv/src/http/tpl') diff --git a/srv/src/http/tpl/admin.html b/srv/src/http/tpl/admin.html index 24b2770..3b10675 100644 --- a/srv/src/http/tpl/admin.html +++ b/srv/src/http/tpl/admin.html @@ -9,6 +9,7 @@ anything without providing credentials. {{ end }} diff --git a/srv/src/http/tpl/draft-posts.html b/srv/src/http/tpl/draft-posts.html new file mode 100644 index 0000000..f89fac5 --- /dev/null +++ b/srv/src/http/tpl/draft-posts.html @@ -0,0 +1,48 @@ +{{ define "body" }} + +

Drafts

+ +

+ + New Draft + +

+ + {{ if ge .Payload.PrevPage 0 }} +

+ < < Previous Page +

+ {{ end }} + + + + {{ range .Payload.Posts }} + + + + + + {{ end }} + +
{{ .Title }} + + Edit + + +
+ +
+
+ + {{ if ge .Payload.NextPage 0 }} +

+ Next Page > > +

+ {{ end }} + +{{ end }} + +{{ template "base.html" . }} diff --git a/srv/src/http/tpl/edit-post.html b/srv/src/http/tpl/edit-post.html index a585b82..ea1f2c1 100644 --- a/srv/src/http/tpl/edit-post.html +++ b/srv/src/http/tpl/edit-post.html @@ -15,6 +15,9 @@ type="text" placeholder="e.g. how-to-fly-a-kite" value="{{ .Payload.Post.ID }}" /> + {{ else if .Payload.IsDraft }} + {{ .Payload.Post.ID }} + {{ else }} {{ .Payload.Post.ID }} @@ -107,10 +110,17 @@

+ {{ if .Payload.IsDraft }} + + Back to Drafts + + {{ else }} Back to Posts + {{ end }}

+ {{ end }} {{ template "base.html" . }} -- cgit v1.2.3