mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-22 23:54:42 +02:00
add group_id field to repo creation forms
This commit is contained in:
parent
92e1da2bd3
commit
902cf739b8
@ -288,6 +288,7 @@ func CreatePost(ctx *context.Context) {
|
|||||||
IsTemplate: form.Template,
|
IsTemplate: form.Template,
|
||||||
TrustModel: repo_model.DefaultTrustModel,
|
TrustModel: repo_model.DefaultTrustModel,
|
||||||
ObjectFormatName: form.ObjectFormatName,
|
ObjectFormatName: form.ObjectFormatName,
|
||||||
|
GroupID: form.ParentGroupID,
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Trace("Repository created [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
|
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](),
|
Template: optional.None[bool](),
|
||||||
StarredByID: ctx.FormInt64("starredBy"),
|
StarredByID: ctx.FormInt64("starredBy"),
|
||||||
IncludeDescription: ctx.FormBool("includeDesc"),
|
IncludeDescription: ctx.FormBool("includeDesc"),
|
||||||
|
GroupID: ctx.FormInt64("group_id"),
|
||||||
}
|
}
|
||||||
|
|
||||||
if ctx.FormString("template") != "" {
|
if ctx.FormString("template") != "" {
|
||||||
@ -540,16 +542,18 @@ func SearchRepo(ctx *context.Context) {
|
|||||||
for i, repo := range repos {
|
for i, repo := range repos {
|
||||||
results[i] = &repo_service.WebSearchRepository{
|
results[i] = &repo_service.WebSearchRepository{
|
||||||
Repository: &api.Repository{
|
Repository: &api.Repository{
|
||||||
ID: repo.ID,
|
ID: repo.ID,
|
||||||
FullName: repo.FullName(),
|
FullName: repo.FullName(),
|
||||||
Fork: repo.IsFork,
|
Fork: repo.IsFork,
|
||||||
Private: repo.IsPrivate,
|
Private: repo.IsPrivate,
|
||||||
Template: repo.IsTemplate,
|
Template: repo.IsTemplate,
|
||||||
Mirror: repo.IsMirror,
|
Mirror: repo.IsMirror,
|
||||||
Stars: repo.NumStars,
|
Stars: repo.NumStars,
|
||||||
HTMLURL: repo.HTMLURL(ctx),
|
HTMLURL: repo.HTMLURL(ctx),
|
||||||
Link: repo.Link(),
|
Link: repo.Link(),
|
||||||
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
|
Internal: !repo.IsPrivate && repo.Owner.Visibility == api.VisibleTypePrivate,
|
||||||
|
GroupSortOrder: repo.GroupSortOrder,
|
||||||
|
GroupID: repo.GroupID,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,7 @@ type CreateRepoForm struct {
|
|||||||
|
|
||||||
ForkSingleBranch string `binding:"MaxSize(255)"`
|
ForkSingleBranch string `binding:"MaxSize(255)"`
|
||||||
ObjectFormatName string
|
ObjectFormatName string
|
||||||
|
ParentGroupID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate validates the fields
|
// Validate validates the fields
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user