1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-09 19:18:20 +00:00

Handle too long PR titles correctly (#16517) (#16549)

Backport #16517

The CompareAndPullRequestPost handler for POST to /compare
incorrectly handles returning errors to the user. For a start
it does not set the necessary markers to switch SimpleMDE
but it also does not immediately return to the form.

This PR fixes this by setting the appropriate values, fixing
the templates and preventing the suggestion of a too long
title.

Fix #16507

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2021-07-26 16:49:48 +01:00
committed by GitHub
parent 91527434d0
commit 693275455e
4 changed files with 64 additions and 4 deletions

View File

@@ -176,10 +176,10 @@
{{if .IsNothingToCompare}}
{{if and $.IsSigned $.AllowEmptyPr (not .Repository.IsArchived) }}
<div class="ui segment">{{.i18n.Tr "repo.pulls.nothing_to_compare_and_allow_empty_pr"}}</div>
<div class="ui info message show-form-container">
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
<button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button>
</div>
<div class="pullrequest-form" style="display: none">
<div class="pullrequest-form" {{if not .Flash}}style="display: none"{{end}}>
{{template "repo/issue/new_form" .}}
</div>
{{else}}
@@ -192,7 +192,7 @@
</div>
{{else}}
{{if and $.IsSigned (not .Repository.IsArchived)}}
<div class="ui info message show-form-container">
<div class="ui info message show-form-container" {{if .Flash}}style="display: none"{{end}}>
<button class="ui button green show-form">{{.i18n.Tr "repo.pulls.new"}}</button>
</div>
{{else if .Repository.IsArchived}}
@@ -201,7 +201,7 @@
</div>
{{end}}
{{if $.IsSigned}}
<div class="pullrequest-form" style="display: none">
<div class="pullrequest-form" {{if not .Flash}}style="display: none"{{end}}>
{{template "repo/issue/new_form" .}}
</div>
{{end}}