From 79a0303516e35e3012cb03792f69f9407cf15f5c Mon Sep 17 00:00:00 2001 From: root Date: Sun, 25 May 2025 22:31:58 +0900 Subject: [PATCH] Support title and body query parameters for new PRs --- routers/web/repo/compare.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 8b99dd95da..b155dda5f9 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -804,6 +804,21 @@ func CompareDiff(ctx *context.Context) { if ctx.Written() { return } + + title := ctx.FormString("title") + body := ctx.FormString("body") + expandNewPRForm := ctx.FormBool("quick_pull") + + if title != "" { + ctx.Data["TitleQuery"] = title + } + if body != "" { + ctx.Data["BodyQuery"] = body + } + if expandNewPRForm || title != "" || body != "" { + ctx.Data["ExpandNewPrForm"] = true + } + _, templateErrs := setTemplateIfExists(ctx, pullRequestTemplateKey, pullRequestTemplateCandidates, pageMetaData) if len(templateErrs) > 0 { ctx.Flash.Warning(renderErrorOfTemplates(ctx, templateErrs), true)