summaryrefslogtreecommitdiffstats
path: root/templates/org
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-04-17 23:35:57 +0800
committerGitHub <noreply@github.com>2023-04-17 11:35:57 -0400
commitf20057271def2240474d64c57eeba8b365642c08 (patch)
tree4b7b081a4ab7b5ba8a593b651fc199d1d59732b4 /templates/org
parent4b1c6cd8e5745a945df0f72233964f6aede8a3a6 (diff)
downloadgitea-f20057271def2240474d64c57eeba8b365642c08.tar.gz
gitea-f20057271def2240474d64c57eeba8b365642c08.zip
Fix Org edit page bugs: renaming detection, maxlength (#24161)
## Before * The renaming detection is wrong (eg: pasting a new name into the input doesn't trigger the detection) * The renaming prompt layout is not good * Some MaxSize/maxlength rules is missing ![image](https://user-images.githubusercontent.com/2114189/232379191-5d0f6d10-56ca-4cec-ac52-7f77b9cb4a8a.png) ![image](https://user-images.githubusercontent.com/2114189/232379234-3289373b-9ddb-4627-ae86-f4d74589fa0c.png) ## After * Fix these problems ![image](https://user-images.githubusercontent.com/2114189/232379098-31c6fa21-c210-4e7f-a337-b38b99670835.png)
Diffstat (limited to 'templates/org')
-rw-r--r--templates/org/create.tmpl2
-rw-r--r--templates/org/settings/options.tmpl15
2 files changed, 9 insertions, 8 deletions
diff --git a/templates/org/create.tmpl b/templates/org/create.tmpl
index f734a39a93..7e988ba0c7 100644
--- a/templates/org/create.tmpl
+++ b/templates/org/create.tmpl
@@ -11,7 +11,7 @@
{{template "base/alert" .}}
<div class="inline required field {{if .Err_OrgName}}error{{end}}">
<label for="org_name">{{.locale.Tr "org.org_name_holder"}}</label>
- <input id="org_name" name="org_name" value="{{.org_name}}" autofocus required>
+ <input id="org_name" name="org_name" value="{{.org_name}}" autofocus required maxlength="40">
<span class="help">{{.locale.Tr "org.org_name_helper"}}</span>
</div>
diff --git a/templates/org/settings/options.tmpl b/templates/org/settings/options.tmpl
index 833b97e347..1caa4210e6 100644
--- a/templates/org/settings/options.tmpl
+++ b/templates/org/settings/options.tmpl
@@ -14,26 +14,27 @@
{{.CsrfTokenHtml}}
<div class="required field {{if .Err_Name}}error{{end}}">
<label for="org_name">{{.locale.Tr "org.org_name_holder"}}
- <span class="text red gt-hidden" id="org-name-change-prompt"> {{.locale.Tr "org.settings.change_orgname_prompt"}}</span>
- <span class="text red gt-hidden" id="org-name-change-redirect-prompt"> {{.locale.Tr "org.settings.change_orgname_redirect_prompt"}}</span>
+ <span class="text red gt-hidden" id="org-name-change-prompt">
+ <br>{{.locale.Tr "org.settings.change_orgname_prompt"}}<br>{{.locale.Tr "org.settings.change_orgname_redirect_prompt"}}
+ </span>
</label>
- <input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required>
+ <input id="org_name" name="name" value="{{.Org.Name}}" data-org-name="{{.Org.Name}}" autofocus required maxlength="40">
</div>
<div class="field {{if .Err_FullName}}error{{end}}">
<label for="full_name">{{.locale.Tr "org.org_full_name_holder"}}</label>
- <input id="full_name" name="full_name" value="{{.Org.FullName}}">
+ <input id="full_name" name="full_name" value="{{.Org.FullName}}" maxlength="100">
</div>
<div class="field {{if .Err_Description}}error{{end}}">
<label for="description">{{$.locale.Tr "org.org_desc"}}</label>
- <textarea id="description" name="description" rows="2">{{.Org.Description}}</textarea>
+ <textarea id="description" name="description" rows="2" maxlength="255">{{.Org.Description}}</textarea>
</div>
<div class="field {{if .Err_Website}}error{{end}}">
<label for="website">{{.locale.Tr "org.settings.website"}}</label>
- <input id="website" name="website" type="url" value="{{.Org.Website}}">
+ <input id="website" name="website" type="url" value="{{.Org.Website}}" maxlength="255">
</div>
<div class="field">
<label for="location">{{.locale.Tr "org.settings.location"}}</label>
- <input id="location" name="location" value="{{.Org.Location}}">
+ <input id="location" name="location" value="{{.Org.Location}}" maxlength="50">
</div>
<div class="ui divider"></div>