aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-07-25 03:59:27 +0100
committerGitHub <noreply@github.com>2021-07-25 03:59:27 +0100
commitfd15fd4c67b22189a18765f888bb3f19e241acbe (patch)
tree56fd40a181097b3741de636179bb370c2a3ce448 /templates
parent4f23624b1674d87142c12ad8a868630c0d2e297f (diff)
downloadgitea-fd15fd4c67b22189a18765f888bb3f19e241acbe.tar.gz
gitea-fd15fd4c67b22189a18765f888bb3f19e241acbe.zip
Handle too long PR titles correctly (#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>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/diff/compare.tmpl8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/repo/diff/compare.tmpl b/templates/repo/diff/compare.tmpl
index 7959ef7bb5..2beca57960 100644
--- a/templates/repo/diff/compare.tmpl
+++ b/templates/repo/diff/compare.tmpl
@@ -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}}