mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Refactor pagination (#33037)
I am sure the simple approach should work, let's try it in 1.24 Follow #29834 and #29841
This commit is contained in:
		| @@ -4,7 +4,6 @@ | ||||
| package org | ||||
|  | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"net/http" | ||||
| 	"path" | ||||
| 	"strings" | ||||
| @@ -146,23 +145,7 @@ func home(ctx *context.Context, viewRepositories bool) { | ||||
| 	ctx.Data["Total"] = count | ||||
|  | ||||
| 	pager := context.NewPagination(int(count), setting.UI.User.RepoPagingNum, page, 5) | ||||
| 	pager.SetDefaultParams(ctx) | ||||
| 	pager.AddParamString("language", language) | ||||
| 	if archived.Has() { | ||||
| 		pager.AddParamString("archived", fmt.Sprint(archived.Value())) | ||||
| 	} | ||||
| 	if fork.Has() { | ||||
| 		pager.AddParamString("fork", fmt.Sprint(fork.Value())) | ||||
| 	} | ||||
| 	if mirror.Has() { | ||||
| 		pager.AddParamString("mirror", fmt.Sprint(mirror.Value())) | ||||
| 	} | ||||
| 	if template.Has() { | ||||
| 		pager.AddParamString("template", fmt.Sprint(template.Value())) | ||||
| 	} | ||||
| 	if private.Has() { | ||||
| 		pager.AddParamString("private", fmt.Sprint(private.Value())) | ||||
| 	} | ||||
| 	pager.AddParamFromRequest(ctx.Req) | ||||
| 	ctx.Data["Page"] = pager | ||||
|  | ||||
| 	ctx.HTML(http.StatusOK, tplOrgHome) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user