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/posts.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/http/tpl/posts.html') diff --git a/src/http/tpl/posts.html b/src/http/tpl/posts.html index 0701459..2fa336d 100644 --- a/src/http/tpl/posts.html +++ b/src/http/tpl/posts.html @@ -1,8 +1,11 @@ {{ define "body" }} - {{ if ge .Payload.PrevPage 0 }} + {{ $page := .GetQueryIntValue "p" 0 -}} + {{ $getPostsRes := .GetPosts $page 20 -}} + + {{ if gt $page 0 }}

- < < Previous Page + < < Previous Page

{{ else }}

@@ -12,10 +15,10 @@ {{ end }}

- {{ if ge .Payload.NextPage 0 }} + {{ if $getPostsRes.HasMore }}

- Next Page > > + Next Page > >

{{ end }} -- cgit v1.2.3