mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-05 12:05:18 +02:00
28 lines
716 B
Go
28 lines
716 B
Go
// Copyright 2025 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package group
|
|
|
|
import (
|
|
repo_model "code.gitea.io/gitea/models/repo"
|
|
"code.gitea.io/gitea/modules/optional"
|
|
"code.gitea.io/gitea/modules/setting"
|
|
"code.gitea.io/gitea/services/context"
|
|
)
|
|
|
|
func LoadHeaderCount(ctx *context.Context) error {
|
|
repoCount, err := repo_model.CountRepository(ctx, repo_model.SearchRepoOptions{
|
|
Actor: ctx.Doer,
|
|
Private: ctx.IsSigned,
|
|
GroupID: ctx.RepoGroup.Group.ID,
|
|
Collaborate: optional.Some(false),
|
|
IncludeDescription: setting.UI.SearchRepoDescription,
|
|
})
|
|
if err != nil {
|
|
return err
|
|
}
|
|
ctx.Data["RepoCount"] = repoCount
|
|
|
|
return nil
|
|
}
|