diff options
-rw-r--r-- | system/admin/handlers.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 765ea6f..fb4d555 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -968,11 +968,12 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { urlFmt := req.URL.Path + "?count=%d&offset=%d&status=%s&type=%s" prevURL := fmt.Sprintf(urlFmt, count, offset-1, status, t) nextURL := fmt.Sprintf(urlFmt, count, offset+1, status, t) - start := 1 + count*offset - end := start + count - 1 + // total may be less than 10 (default count), so reset count to match total if total < count { count = total } + start := 1 + count*offset + end := start + count - 1 pagination := fmt.Sprintf(` <ul class="pagination row"> |