Archived
1
0
This commit is contained in:
Jeff Becker 2018-03-09 10:18:47 -05:00
parent 7abd41eecd
commit 7c5546c0c0
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -244,7 +244,7 @@ func (self *templateEngine) genBoardPage(allowFiles, requireCaptcha bool, prefix
perpage, _ := db.GetThreadsPerPage(newsgroup) perpage, _ := db.GetThreadsPerPage(newsgroup)
var boardPage BoardModel var boardPage BoardModel
if invertPagination { if invertPagination {
boardPage = db.GetGroupForPage(prefix, frontend, newsgroup, int(pages)-page, int(perpage)) boardPage = db.GetGroupForPage(prefix, frontend, newsgroup, int(pages-1)-page, int(perpage))
} else { } else {
boardPage = db.GetGroupForPage(prefix, frontend, newsgroup, page, int(perpage)) boardPage = db.GetGroupForPage(prefix, frontend, newsgroup, page, int(perpage))
} }
@ -283,15 +283,13 @@ func (self *templateEngine) genUkkoPaginated(prefix, frontend string, wr io.Writ
} }
} }
obj := map[string]interface{}{"prefix": prefix, "threads": threads, "page": page} obj := map[string]interface{}{"prefix": prefix, "threads": threads, "page": page}
if invertPagination && page < pages { if invertPagination {
obj["prev"] = map[string]interface{}{"no": page + 1} obj["prev"] = map[string]interface{}{"no": page - 1}
} else if page > 0 { } else if page > 0 {
obj["prev"] = map[string]interface{}{"no": page - 1} obj["prev"] = map[string]interface{}{"no": page - 1}
} }
if invertPagination { if invertPagination {
if page > 0 { obj["next"] = map[string]interface{}{"no": page + 1}
obj["next"] = map[string]interface{}{"no": page - 1}
}
} else { } else {
if page < 10 { if page < 10 {
obj["next"] = map[string]interface{}{"no": page + 1} obj["next"] = map[string]interface{}{"no": page + 1}