From e7d1ca73626ff7ba41895aa37bc716aef4e994f5 Mon Sep 17 00:00:00 2001 From: vnpower Date: Sat, 21 Oct 2023 15:49:26 +0700 Subject: [PATCH] Fix: next page is broken when there is no page limit #34 --- handler/template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/handler/template.go b/handler/template.go index c90c498..6b8dd5f 100644 --- a/handler/template.go +++ b/handler/template.go @@ -133,11 +133,12 @@ func CreatePaginator(base, ending string, current_page, max_page int) template.H count++ } - pages += fmt.Sprintf(``, base, min(max_page, current_page+1), ending) if max_page == -1 { + pages += fmt.Sprintf(``, base, current_page+1, ending) pages += fmt.Sprintf(`»`, base, max_page, ending) } else { + pages += fmt.Sprintf(``, base, min(max_page, current_page+1), ending) pages += fmt.Sprintf(`»`, base, max_page, ending) }