aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo/issue
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2019-11-25 01:06:23 +0200
committerGitHub <noreply@github.com>2019-11-25 01:06:23 +0200
commit95c3dc856a7d4199232549e3b4d76769ef868bda (patch)
tree40eed5392b00881f5e0e078012cc11e24637913c /templates/repo/issue
parente8241bf55e0ff683933f9c7b51b8ee5956965bdf (diff)
downloadgitea-95c3dc856a7d4199232549e3b4d76769ef868bda.tar.gz
gitea-95c3dc856a7d4199232549e3b4d76769ef868bda.zip
Fix max length check and limit in multiple repo forms (#9148)
* Fix input field max length for release, label and milestone forms * Add max length for isseu and PR title
Diffstat (limited to 'templates/repo/issue')
-rw-r--r--templates/repo/issue/labels.tmpl12
-rw-r--r--templates/repo/issue/milestone_new.tmpl2
-rw-r--r--templates/repo/issue/new_form.tmpl2
-rw-r--r--templates/repo/issue/view_title.tmpl2
4 files changed, 9 insertions, 9 deletions
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl
index 956fc955a0..176304278f 100644
--- a/templates/repo/issue/labels.tmpl
+++ b/templates/repo/issue/labels.tmpl
@@ -17,16 +17,16 @@
<div class="ui grid">
<div class="three wide column">
<div class="ui small input">
- <input class="new-label-input emoji-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
+ <input class="new-label-input emoji-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
</div>
</div>
<div class="five wide column">
<div class="ui small fluid input">
- <input class="new-label-desc-input" name="description" placeholder="{{.i18n.Tr "repo.issues.new_label_desc_placeholder"}}">
+ <input class="new-label-desc-input" name="description" placeholder="{{.i18n.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
</div>
</div>
<div class="color picker column">
- <input class="color-picker" name="color" value="#70c24a" required>
+ <input class="color-picker" name="color" value="#70c24a" required maxlength="7">
</div>
<div class="column precolors">
{{template "repo/issue/label_precolors"}}
@@ -151,16 +151,16 @@
<div class="ui grid">
<div class="three wide column">
<div class="ui small input">
- <input class="new-label-input emoji-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required>
+ <input class="new-label-input emoji-input" name="title" placeholder="{{.i18n.Tr "repo.issues.new_label_placeholder"}}" autofocus required maxlength="50">
</div>
</div>
<div class="five wide column">
<div class="ui small fluid input">
- <input class="new-label-desc-input" name="description" placeholder="{{.i18n.Tr "repo.issues.new_label_desc_placeholder"}}">
+ <input class="new-label-desc-input" name="description" placeholder="{{.i18n.Tr "repo.issues.new_label_desc_placeholder"}}" maxlength="200">
</div>
</div>
<div class="color picker column">
- <input class="color-picker" name="color" value="#70c24a" required>
+ <input class="color-picker" name="color" value="#70c24a" required maxlength="7">
</div>
<div class="column precolors">
{{template "repo/issue/label_precolors"}}
diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl
index 30a7d7ebbb..ea704c0561 100644
--- a/templates/repo/issue/milestone_new.tmpl
+++ b/templates/repo/issue/milestone_new.tmpl
@@ -26,7 +26,7 @@
<div class="eleven wide column">
<div class="field {{if .Err_Title}}error{{end}}">
<label>{{.i18n.Tr "repo.milestones.title"}}</label>
- <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required>
+ <input name="title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" autofocus required maxlength="50">
</div>
<div class="field">
<label>{{.i18n.Tr "repo.milestones.desc"}}</label>
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl
index d0e124a178..a4742b32fb 100644
--- a/templates/repo/issue/new_form.tmpl
+++ b/templates/repo/issue/new_form.tmpl
@@ -13,7 +13,7 @@
</a>
<div class="ui segment content">
<div class="field">
- <input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" tabindex="3" autofocus required>
+ <input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" tabindex="3" autofocus required maxlength="255">
{{if .PageIsComparePull}}
<div class="title_wip_desc">{{.i18n.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div>
{{end}}
diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl
index 4b254d2c4b..e97ca3265c 100644
--- a/templates/repo/issue/view_title.tmpl
+++ b/templates/repo/issue/view_title.tmpl
@@ -3,7 +3,7 @@
<h1 class="twelve wide column">
<span class="index">#{{.Issue.Index}}</span> <span id="issue-title" class="has-emoji">{{.Issue.Title}}</span>
<div id="edit-title-input" class="ui input" style="display: none">
- <input value="{{.Issue.Title}}">
+ <input value="{{.Issue.Title}}" maxlength="255">
</div>
</h1>
{{if and (or .IsIssueWriter .IsIssuePoster) (not .Repository.IsArchived)}}