mirror of https://github.com/go-gitea/gitea.git
Support title and body query parameters for new PRs
parent
9b295e984a
commit
79a0303516
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue