forked from kevadesu/forgejo
Some repository refactors (#17950)
* some repository refactors * remove unnecessary code * Fix test * Remove unnecessary banner
This commit is contained in:
parent
0a7e8327a0
commit
5723240490
88 changed files with 1363 additions and 1388 deletions
|
@ -822,7 +822,7 @@ func renderLanguageStats(ctx *context.Context) {
|
|||
}
|
||||
|
||||
func renderRepoTopics(ctx *context.Context) {
|
||||
topics, _, err := models.FindTopics(&models.FindTopicOptions{
|
||||
topics, _, err := repo_model.FindTopics(&repo_model.FindTopicOptions{
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
})
|
||||
if err != nil {
|
||||
|
@ -931,7 +931,7 @@ func Watchers(ctx *context.Context) {
|
|||
ctx.Data["PageIsWatchers"] = true
|
||||
|
||||
RenderUserCards(ctx, ctx.Repo.Repository.NumWatches, func(opts db.ListOptions) ([]*user_model.User, error) {
|
||||
return models.GetRepoWatchers(ctx.Repo.Repository.ID, opts)
|
||||
return repo_model.GetRepoWatchers(ctx.Repo.Repository.ID, opts)
|
||||
}, tplWatchers)
|
||||
}
|
||||
|
||||
|
@ -941,7 +941,7 @@ func Stars(ctx *context.Context) {
|
|||
ctx.Data["CardsTitle"] = ctx.Tr("repo.stargazers")
|
||||
ctx.Data["PageIsStargazers"] = true
|
||||
RenderUserCards(ctx, ctx.Repo.Repository.NumStars, func(opts db.ListOptions) ([]*user_model.User, error) {
|
||||
return models.GetStargazers(ctx.Repo.Repository, opts)
|
||||
return repo_model.GetStargazers(ctx.Repo.Repository, opts)
|
||||
}, tplWatchers)
|
||||
}
|
||||
|
||||
|
@ -957,7 +957,7 @@ func Forks(ctx *context.Context) {
|
|||
pager := context.NewPagination(ctx.Repo.Repository.NumForks, models.ItemsPerPage, page, 5)
|
||||
ctx.Data["Page"] = pager
|
||||
|
||||
forks, err := models.GetForks(ctx.Repo.Repository, db.ListOptions{
|
||||
forks, err := repo_model.GetForks(ctx.Repo.Repository, db.ListOptions{
|
||||
Page: pager.Paginater.Current(),
|
||||
PageSize: models.ItemsPerPage,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue