0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-06-13 08:32:49 +02:00

Support title and body query parameters for new PRs

This commit is contained in:
root 2025-05-25 22:31:58 +09:00
parent 9b295e984a
commit 79a0303516

View File

@ -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)