commits: able to specify pageSize dynamically (#3965)

Usage: <url>?page={page}&pageSize={pageSize}

Also avoid/removed getting total commits count for pagination,
users are only allowed navigation by 'newer' and 'older'.
This commit is contained in:
Unknwon
2017-02-18 18:37:47 -05:00
parent 685737b816
commit c69900325d
11 changed files with 106 additions and 110 deletions

View File

@@ -170,8 +170,12 @@ func (c *Commit) CommitsCount() (int64, error) {
return CommitsCount(c.repo.Path, c.ID.String())
}
func (c *Commit) CommitsByRangeSize(page, size int) (*list.List, error) {
return c.repo.CommitsByRangeSize(c.ID.String(), page, size)
}
func (c *Commit) CommitsByRange(page int) (*list.List, error) {
return c.repo.commitsByRange(c.ID, page)
return c.repo.CommitsByRange(c.ID.String(), page)
}
func (c *Commit) CommitsBefore() (*list.List, error) {