summaryrefslogtreecommitdiff
path: root/srv/src/api/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'srv/src/api/tpl')
-rw-r--r--srv/src/api/tpl/index.html48
1 files changed, 28 insertions, 20 deletions
diff --git a/srv/src/api/tpl/index.html b/srv/src/api/tpl/index.html
index b71dc01..1858ea8 100644
--- a/srv/src/api/tpl/index.html
+++ b/srv/src/api/tpl/index.html
@@ -1,28 +1,36 @@
{{ define "body" }}
-<ul id="posts-list">
-
- {{ range .Posts }}
- <li>
- <h2>
- <a href="{{ .HTTPPath }}">{{ .Title }}</a>
- </h2>
- <span>{{ .PublishedAt.Format "2006-01-02" }}</span>
- {{ if not .LastUpdatedAt.IsZero }}
- <span>(Updated {{ .LastUpdatedAt.Format "2006-01-02" }})</span>
+
+ <ul id="posts-list">
+
+ {{ range .Posts }}
+ <li>
+ <h2>
+ <a href="posts/{{ .HTTPPath }}">{{ .Title }}</a>
+ </h2>
+ <span>{{ .PublishedAt.Format "2006-01-02" }}</span>
+ {{ if not .LastUpdatedAt.IsZero }}
+ <span>(Updated {{ .LastUpdatedAt.Format "2006-01-02" }})</span>
+ {{ end }}
+ <p>{{ .Description }}</p>
+ </li>
{{ end }}
- <p>{{ .Description }}</p>
- </li>
- {{ end }}
-</ul>
-{{ end }}
+ </ul>
-{{ if ge .PrevPage 0 }}
-<a href="?p={{ .PrevPage}}">Previous</a>
-{{ end }}
+ {{ if or (ge .PrevPage 0) (ge .NextPage 0) }}
+ <div id="page-turner">
+
+ {{ if ge .PrevPage 0 }}
+ <a style="float: left;" href="?p={{ .PrevPage}}">Newer</a>
+ {{ end }}
+
+ {{ if ge .NextPage 0 }}
+ <a style="float:right;" href="?p={{ .NextPage}}">Older</a>
+ {{ end }}
+
+ </div>
+ {{ end }}
-{{ if ge .NextPage 0 }}
-<a href="?p={{ .NextPage}}">Next</a>
{{ end }}
{{ template "base.html" . }}