From a53aec78899dad3d9ccdac86677d0b3918a4c876 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 6 Dec 2016 01:47:04 -0800 Subject: adding disabled zero-content pagination and minor fixes --- system/admin/handlers.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'system') diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 6293974..6b5de26 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -976,6 +976,10 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { start := 1 + count*offset end := start + count - 1 + if total < end { + end = total + } + pagination := fmt.Sprintf(` `, prevStatus, prevURL, start, end, total, nextStatus, nextURL) + // show indicator that a collection of items will be listed implicitly, but + // that none are created yet + if total < 1 { + pagination = ` + + ` + } + b.Write([]byte(pagination + ``)) script := ` -- cgit v1.2.3