forked from forgejo/forgejo
parent
7e382a5555
commit
f3fbb7c67d
9 changed files with 211 additions and 106 deletions
|
@ -14,6 +14,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/markup"
|
||||
"code.gitea.io/gitea/modules/markup/markdown"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
)
|
||||
|
||||
// prepareContextForCommonProfile store some common data into context data for user's profile related pages (including the nav menu)
|
||||
|
@ -110,3 +111,21 @@ func RenderUserHeader(ctx *context.Context) {
|
|||
defer profileClose()
|
||||
ctx.Data["HasProfileReadme"] = profileReadmeBlob != nil
|
||||
}
|
||||
|
||||
func LoadHeaderCount(ctx *context.Context) error {
|
||||
prepareContextForCommonProfile(ctx)
|
||||
|
||||
repoCount, err := repo_model.CountRepository(ctx, &repo_model.SearchRepoOptions{
|
||||
Actor: ctx.Doer,
|
||||
OwnerID: ctx.ContextUser.ID,
|
||||
Private: ctx.IsSigned,
|
||||
Collaborate: util.OptionalBoolFalse,
|
||||
IncludeDescription: setting.UI.SearchRepoDescription,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
ctx.Data["RepoCount"] = repoCount
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue