From 93a8843e2e3391459fd333aef9e5c7617608c2b3 Mon Sep 17 00:00:00 2001
From: Brian Picciano
Date: Sat, 18 May 2024 15:55:59 +0200
Subject: Remove most rendering related querying from go http handlers
---
src/http/tpl/draft-posts-manage.html | 26 ++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)
(limited to 'src/http/tpl/draft-posts-manage.html')
diff --git a/src/http/tpl/draft-posts-manage.html b/src/http/tpl/draft-posts-manage.html
index 5454f24..b1b4362 100644
--- a/src/http/tpl/draft-posts-manage.html
+++ b/src/http/tpl/draft-posts-manage.html
@@ -1,5 +1,15 @@
{{ define "body" }}
+ {{ $page := .GetQueryIntValue "p" 0 -}}
+ {{ $getPostsRes := .GetDraftPosts $page 20 -}}
+
+
+
Back to Admin
@@ -10,15 +20,15 @@
New Draft
- {{ if ge .Payload.PrevPage 0 }}
+ {{ if gt $page 0 }}
- < < Previous Page
+ < < Previous Page
{{ end }}
- {{ if ge .Payload.NextPage 0 }}
+ {{ if $getPostsRes.HasMore }}
- Next Page > >
+ Next Page > >
{{ end }}
--
cgit v1.2.3