Fix admin/user pagination
Integer division floor the page count but the ceil operation is needed. Implemented without float conversion.
This commit is contained in:
parent
f88aa393c5
commit
b643e0520f
1 changed files with 1 additions and 1 deletions
2
admin.go
2
admin.go
|
@ -208,7 +208,7 @@ func handleViewAdminUsers(app *App, u *User, w http.ResponseWriter, r *http.Requ
|
|||
|
||||
p.Flashes, _ = getSessionFlashes(app, w, r, nil)
|
||||
p.TotalUsers = app.db.GetAllUsersCount()
|
||||
ttlPages := p.TotalUsers / adminUsersPerPage
|
||||
ttlPages := (p.TotalUsers - 1) / adminUsersPerPage + 1
|
||||
p.TotalPages = []int{}
|
||||
for i := 1; i <= int(ttlPages); i++ {
|
||||
p.TotalPages = append(p.TotalPages, i)
|
||||
|
|
Loading…
Add table
Reference in a new issue