1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-18 00:08:35 +00:00

Fix git graph page (#34948)

fix #34946
This commit is contained in:
wxiaoguang
2025-07-04 23:41:19 +08:00
committed by GitHub
parent 41678e1a57
commit 70685a9489
10 changed files with 90 additions and 210 deletions

View File

@@ -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, "&"))