mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							40dc458bb6
						
					
				
				
					commit
					fcbac38d6f
				
			@@ -17,8 +17,6 @@ import (
 | 
			
		||||
	"code.gitea.io/gitea/modules/setting"
 | 
			
		||||
	"code.gitea.io/gitea/modules/util"
 | 
			
		||||
	"code.gitea.io/gitea/routers/user"
 | 
			
		||||
 | 
			
		||||
	"github.com/Unknwon/paginater"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
const (
 | 
			
		||||
@@ -151,10 +149,13 @@ func RenderRepoSearch(ctx *context.Context, opts *RepoSearchOptions) {
 | 
			
		||||
	}
 | 
			
		||||
	ctx.Data["Keyword"] = keyword
 | 
			
		||||
	ctx.Data["Total"] = count
 | 
			
		||||
	ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, page, 5)
 | 
			
		||||
	ctx.Data["Repos"] = repos
 | 
			
		||||
	ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
 | 
			
		||||
 | 
			
		||||
	pager := context.NewPagination(int(count), opts.PageSize, page, 5)
 | 
			
		||||
	pager.SetDefaultParams(ctx)
 | 
			
		||||
	ctx.Data["Page"] = pager
 | 
			
		||||
 | 
			
		||||
	ctx.HTML(200, opts.TplName)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -222,11 +223,14 @@ func RenderUserSearch(ctx *context.Context, opts *models.SearchUserOptions, tplN
 | 
			
		||||
	}
 | 
			
		||||
	ctx.Data["Keyword"] = opts.Keyword
 | 
			
		||||
	ctx.Data["Total"] = count
 | 
			
		||||
	ctx.Data["Page"] = paginater.New(int(count), opts.PageSize, opts.Page, 5)
 | 
			
		||||
	ctx.Data["Users"] = users
 | 
			
		||||
	ctx.Data["ShowUserEmail"] = setting.UI.ShowUserEmail
 | 
			
		||||
	ctx.Data["IsRepoIndexerEnabled"] = setting.Indexer.RepoIndexerEnabled
 | 
			
		||||
 | 
			
		||||
	pager := context.NewPagination(int(count), opts.PageSize, opts.Page, 5)
 | 
			
		||||
	pager.SetDefaultParams(ctx)
 | 
			
		||||
	ctx.Data["Page"] = pager
 | 
			
		||||
 | 
			
		||||
	ctx.HTML(200, tplName)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -364,11 +368,14 @@ func ExploreCode(ctx *context.Context) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	ctx.Data["Keyword"] = keyword
 | 
			
		||||
	pager := paginater.New(total, setting.UI.RepoSearchPagingNum, page, 5)
 | 
			
		||||
	ctx.Data["Page"] = pager
 | 
			
		||||
	ctx.Data["SearchResults"] = searchResults
 | 
			
		||||
	ctx.Data["RequireHighlightJS"] = true
 | 
			
		||||
	ctx.Data["PageIsViewCode"] = true
 | 
			
		||||
 | 
			
		||||
	pager := context.NewPagination(total, setting.UI.RepoSearchPagingNum, page, 5)
 | 
			
		||||
	pager.SetDefaultParams(ctx)
 | 
			
		||||
	ctx.Data["Page"] = pager
 | 
			
		||||
 | 
			
		||||
	ctx.HTML(200, tplExploreCode)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user