From 0118b6aaf8ada3edd67cb975c776f6f124178ad2 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Sun, 8 Sep 2019 03:28:40 -0500 Subject: Add option to initialize repository with labels (#6061) * Add optional label sets on repo creation * Fix CRLF * Instead of hardcoding default, make it the helper * Move label set init out of repo init Add a new error for the router Combine router label init with repo creation label init Signed-off-by: jolheiser * Add issue labels to Swagger for repo creation Signed-off-by: jolheiser * Update models/issue_label.go Co-Authored-By: Lauris BH * Update models/issue_label.go Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> --- routers/repo/repo.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'routers/repo/repo.go') diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 53244f304c..b67384d721 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -115,6 +115,7 @@ func Create(ctx *context.Context) { // Give default value for template to render. ctx.Data["Gitignores"] = models.Gitignores + ctx.Data["LabelTemplates"] = models.LabelTemplates ctx.Data["Licenses"] = models.Licenses ctx.Data["Readmes"] = models.Readmes ctx.Data["readme"] = "Default" @@ -155,6 +156,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) { ctx.Data["Title"] = ctx.Tr("new_repo") ctx.Data["Gitignores"] = models.Gitignores + ctx.Data["LabelTemplates"] = models.LabelTemplates ctx.Data["Licenses"] = models.Licenses ctx.Data["Readmes"] = models.Readmes @@ -173,6 +175,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) { Name: form.RepoName, Description: form.Description, Gitignores: form.Gitignores, + IssueLabels: form.IssueLabels, License: form.License, Readme: form.Readme, IsPrivate: form.Private || setting.Repository.ForcePrivate, -- cgit v1.2.3