From 1242be7cfec1faa6a880d625307e32a1a91937ac Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 20 May 2022 08:36:52 -0600 Subject: Implement posts index page --- srv/src/api/tpl/posts.html | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 srv/src/api/tpl/posts.html (limited to 'srv/src/api/tpl/posts.html') diff --git a/srv/src/api/tpl/posts.html b/srv/src/api/tpl/posts.html new file mode 100644 index 0000000..e701f59 --- /dev/null +++ b/srv/src/api/tpl/posts.html @@ -0,0 +1,61 @@ +{{ define "posts-nextprev" }} + + {{ if or (ge .Payload.PrevPage 0) (ge .Payload.NextPage 0) }} +
+ + {{ if ge .Payload.PrevPage 0 }} + Newer + {{ end }} + + {{ if ge .Payload.NextPage 0 }} + Older + {{ end }} + +
+ {{ end }} + +{{ end }} + +{{ define "body" }} + + {{ $csrfFormInput := .CSRFFormInput }} + + +

+ + + +

+ + {{ template "posts-nextprev" . }} + + + + {{ range .Payload.Posts }} + + + + + + + {{ end }} + +
{{ .PublishedAt }}{{ .Title }} + + + + +
+ {{ $csrfFormInput }} + +
+
+ + {{ template "posts-nextprev" . }} + +{{ end }} + +{{ template "base.html" . }} -- cgit v1.2.3