summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go16
1 files changed, 16 insertions, 0 deletions
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(`
<ul class="pagination row">
<li class="col s2 waves-effect %s"><a href="%s"><i class="material-icons">chevron_left</i></a></li>
@@ -984,6 +988,18 @@ func postsHandler(res http.ResponseWriter, req *http.Request) {
</ul>
`, 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 = `
+ <ul class="pagination row">
+ <li class="col s2 waves-effect disabled"><a href="#"><i class="material-icons">chevron_left</i></a></li>
+ <li class="col s8">0 to 0 of 0</li>
+ <li class="col s2 waves-effect disabled"><a href="#"><i class="material-icons">chevron_right</i></a></li>
+ </ul>
+ `
+ }
+
b.Write([]byte(pagination + `</div></div>`))
script := `