summaryrefslogtreecommitdiff
path: root/srv/src/http/tpl/index.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/index.html
parentf69ed83de73bbfc4b7af0931de6ced8cf12dea61 (diff)
Rename api package to http
Diffstat (limited to 'srv/src/http/tpl/index.html')
-rw-r--r--srv/src/http/tpl/index.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/srv/src/http/tpl/index.html b/srv/src/http/tpl/index.html
new file mode 100644
index 0000000..e27cbef
--- /dev/null
+++ b/srv/src/http/tpl/index.html
@@ -0,0 +1,36 @@
+{{ define "body" }}
+
+ <ul id="posts-list">
+
+ {{ range .Payload.Posts }}
+ <li>
+ <h2>
+ <a href="{{ PostURL .ID }}">{{ .Title }}</a>
+ </h2>
+ <span>{{ DateTimeFormat .PublishedAt }}</span>
+ {{ if not .LastUpdatedAt.IsZero }}
+ <span>(Updated {{ DateTimeFormat .LastUpdatedAt }})</span>
+ {{ end }}
+ <p>{{ .Description }}</p>
+ </li>
+ {{ end }}
+
+ </ul>
+
+ {{ if or (ge .Payload.PrevPage 0) (ge .Payload.NextPage 0) }}
+ <div id="page-turner">
+
+ {{ if ge .Payload.PrevPage 0 }}
+ <a style="float: left;" href="?p={{ .Payload.PrevPage}}">Newer</a>
+ {{ end }}
+
+ {{ if ge .Payload.NextPage 0 }}
+ <a style="float:right;" href="?p={{ .Payload.NextPage}}">Older</a>
+ {{ end }}
+
+ </div>
+ {{ end }}
+
+{{ end }}
+
+{{ template "base.html" . }}