0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 03:35:05 +02:00

add group_id field to repo creation forms

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-08-14 21:32:34 -04:00
parent 92e1da2bd3
commit 902cf739b8
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C
2 changed files with 15 additions and 10 deletions

View File

@ -288,6 +288,7 @@ func CreatePost(ctx *context.Context) {
IsTemplate: form.Template,
TrustModel: repo_model.DefaultTrustModel,
ObjectFormatName: form.ObjectFormatName,
GroupID: form.ParentGroupID,
})
if err == nil {
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
@ -450,6 +451,7 @@ func SearchRepo(ctx *context.Context) {
Template: optional.None[bool](),
StarredByID: ctx.FormInt64("starredBy"),
IncludeDescription: ctx.FormBool("includeDesc"),
GroupID: ctx.FormInt64("group_id"),
}
if ctx.FormString("template") != "" {
@ -540,16 +542,18 @@ func SearchRepo(ctx *context.Context) {
for i, repo := range repos {
results[i] = &repo_service.WebSearchRepository{
Repository: &api.Repository{
ID: repo.ID,
FullName: repo.FullName(),
Fork: repo.IsFork,
Private: repo.IsPrivate,
Template: repo.IsTemplate,
Mirror: repo.IsMirror,
Stars: repo.NumStars,
HTMLURL: repo.HTMLURL(ctx),
Link: repo.Link(),
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
ID: repo.ID,
FullName: repo.FullName(),
Fork: repo.IsFork,
Private: repo.IsPrivate,
Template: repo.IsTemplate,
Mirror: repo.IsMirror,
Stars: repo.NumStars,
HTMLURL: repo.HTMLURL(ctx),
Link: repo.Link(),
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
GroupSortOrder: repo.GroupSortOrder,
GroupID: repo.GroupID,
},
}

View File

@ -43,6 +43,7 @@ type CreateRepoForm struct {
ForkSingleBranch string `binding:"MaxSize(255)"`
ObjectFormatName string
ParentGroupID int64
}
// Validate validates the fields