mirror of
https://github.com/go-gitea/gitea
synced 2025-07-18 00:08:35 +00:00
@@ -33,8 +33,8 @@ func (p *Pagination) WithCurRows(n int) *Pagination {
|
||||
return p
|
||||
}
|
||||
|
||||
func (p *Pagination) AddParamFromRequest(req *http.Request) {
|
||||
for key, values := range req.URL.Query() {
|
||||
func (p *Pagination) AddParamFromQuery(q url.Values) {
|
||||
for key, values := range q {
|
||||
if key == "page" || len(values) == 0 || (len(values) == 1 && values[0] == "") {
|
||||
continue
|
||||
}
|
||||
@@ -45,6 +45,10 @@ func (p *Pagination) AddParamFromRequest(req *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *Pagination) AddParamFromRequest(req *http.Request) {
|
||||
p.AddParamFromQuery(req.URL.Query())
|
||||
}
|
||||
|
||||
// GetParams returns the configured URL params
|
||||
func (p *Pagination) GetParams() template.URL {
|
||||
return template.URL(strings.Join(p.urlParams, "&"))
|
||||
|
Reference in New Issue
Block a user