summaryrefslogtreecommitdiff
path: root/src/http/tpl/posts-manage.html
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/tpl/posts-manage.html')
-rw-r--r--src/http/tpl/posts-manage.html14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/http/tpl/posts-manage.html b/src/http/tpl/posts-manage.html
index 96b30ca..f9adbc1 100644
--- a/src/http/tpl/posts-manage.html
+++ b/src/http/tpl/posts-manage.html
@@ -1,4 +1,8 @@
{{ define "body" }}
+
+ {{ $page := .GetQueryIntValue "p" 0 -}}
+ {{ $getPostsRes := .GetPosts $page 20 -}}
+
<script>
function confirmDelete(event) {
if (!confirm("Are you sure you want to delete this post?"))
@@ -12,9 +16,9 @@
<h1>Posts</h1>
- {{ if ge .Payload.PrevPage 0 }}
+ {{ if gt $page 0 }}
<p>
- <a href="?method=manage&p={{ .Payload.PrevPage}}">&lt; &lt; Previous Page</a>
+ <a href="?method=manage&p={{ .Add $page -1 }}">&lt; &lt; Previous Page</a>
</p>
{{ end }}
@@ -26,7 +30,7 @@
<col span="1" style="width: auto;">
</colgroup>
- {{ range .Payload.Posts }}
+ {{ range $getPostsRes.Posts }}
<tr>
<td>{{ .PublishedAt.Local.Format "2006-01-02 15:04:05 MST" }}</td>
<td><a href="{{ PostURL .ID }}">{{ .Title }}</a></td>
@@ -52,9 +56,9 @@
</table>
- {{ if ge .Payload.NextPage 0 }}
+ {{ if $getPostsRes.HasMore }}
<p>
- <a href="?method=manage&p={{ .Payload.NextPage}}">Next Page &gt; &gt;</a>
+ <a href="?method=manage&p={{ .Add $page 1 }}">Next Page &gt; &gt;</a>
</p>
{{ end }}