Signed-off-by: dusk y.bera003.06@protonmail.com
appview/db/issues.go
appview/db/issues.go
This file has not been changed.
appview/db/notifications.go
appview/db/notifications.go
This file has not been changed.
appview/issues/issues.go
appview/issues/issues.go
This file has not been changed.
appview/issues/router.go
appview/issues/router.go
This file has not been changed.
appview/middleware/middleware.go
appview/middleware/middleware.go
This file has not been changed.
appview/notifications/notifications.go
appview/notifications/notifications.go
This file has not been changed.
appview/pages/pages.go
appview/pages/pages.go
This file has not been changed.
appview/pages/templates/goodfirstissues/index.html
appview/pages/templates/goodfirstissues/index.html
This file has not been changed.
appview/pages/templates/notifications/list.html
appview/pages/templates/notifications/list.html
This file has not been changed.
appview/pages/templates/repo/issues/issues.html
appview/pages/templates/repo/issues/issues.html
This file has not been changed.
appview/pagination/page.go
appview/pagination/page.go
This file has not been changed.
appview/repo/feed.go
appview/repo/feed.go
This file has not been changed.
+2
-2
appview/state/gfi.go
+2
-2
appview/state/gfi.go
···
62
62
return
63
63
}
64
64
65
-
pagination := pagination.NewFromPage(page, len(allIssues))
66
-
67
65
var goodFirstIssues []models.Issue
68
66
for _, issue := range allIssues {
69
67
if issue.Labels.ContainsLabel(goodFirstIssueLabel) {
···
101
99
return sortedGroups[i].Repo.Name < sortedGroups[j].Repo.Name
102
100
})
103
101
102
+
pagination := pagination.NewFromPage(page, len(sortedGroups))
103
+
104
104
groupStart := page.Count * page.No
105
105
groupEnd := page.Count * (page.No + 1)
106
106
if groupStart > len(sortedGroups) {
History
4 rounds
2 comments
expand 0 comments
closed without merging
expand 0 comments
expand 1 comment
expand 1 comment
this helper is quite strange. can we use a slightly better API? the page size does not belong in the FirstPage method (although i understand it was previously hardcoded here).
we can do something like p := NewPagination(WithSize(N), WithOffset(0), WithTotal(...)) and have p.FirstPage() perhaps.
i went with a page number api and made pagination produce pages instead, i think it fits it better (pagination still uses offset / limit / total though ofc)