aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user/settings/profile.tmpl
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2023-05-26 11:42:54 +0200
committerGitHub <noreply@github.com>2023-05-26 09:42:54 +0000
commit85fa954a3810b233cb299f455546c4b2314400b3 (patch)
tree9cf4b3955c59b6c38aba1b1df07d14843aaef375 /templates/user/settings/profile.tmpl
parent18f26cfbf7f9b36b838c0e8762bfba98c89b9797 (diff)
downloadgitea-85fa954a3810b233cb299f455546c4b2314400b3.tar.gz
gitea-85fa954a3810b233cb299f455546c4b2314400b3.zip
Improve some Forms (#24878)
Don't really know a better name for this. I've gone through some Forms and added missing HTML attributes (mostly `maxlength`). I tried to fill the Forms with dummy Data and see if Gitea throws a Error (e.g. maximum length). If yes, I added the missing HTML attribute. While working on this, I discovered that the Form to add OAuth2 Apps just silently fails when filled with invalid data, so I fixed that too.
Diffstat (limited to 'templates/user/settings/profile.tmpl')
-rw-r--r--templates/user/settings/profile.tmpl10
1 files changed, 5 insertions, 5 deletions
diff --git a/templates/user/settings/profile.tmpl b/templates/user/settings/profile.tmpl
index dc1bbc84d5..e6ba283a0c 100644
--- a/templates/user/settings/profile.tmpl
+++ b/templates/user/settings/profile.tmpl
@@ -12,14 +12,14 @@
<span class="text red gt-hidden" id="name-change-prompt"> {{.locale.Tr "settings.change_username_prompt"}}</span>
<span class="text red gt-hidden" id="name-change-redirect-prompt"> {{.locale.Tr "settings.change_username_redirect_prompt"}}</span>
</label>
- <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}disabled{{end}}>
+ <input id="username" name="name" value="{{.SignedUser.Name}}" data-name="{{.SignedUser.Name}}" autofocus required {{if or (not .SignedUser.IsLocal) .IsReverseProxy}}disabled{{end}} maxlength="40">
{{if or (not .SignedUser.IsLocal) .IsReverseProxy}}
<p class="help text blue">{{$.locale.Tr "settings.password_username_disabled"}}</p>
{{end}}
</div>
<div class="field {{if .Err_FullName}}error{{end}}">
<label for="full_name">{{.locale.Tr "settings.full_name"}}</label>
- <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}">
+ <input id="full_name" name="full_name" value="{{.SignedUser.FullName}}" maxlength="100">
</div>
<div class="field {{if .Err_Email}}error{{end}}">
<label for="email">{{.locale.Tr "email"}}</label>
@@ -33,15 +33,15 @@
</div>
<div class="field {{if .Err_Description}}error{{end}}">
<label for="description">{{$.locale.Tr "user.user_bio"}}</label>
- <textarea id="description" name="description" rows="2" placeholder="{{.locale.Tr "settings.biography_placeholder"}}">{{.SignedUser.Description}}</textarea>
+ <textarea id="description" name="description" rows="2" placeholder="{{.locale.Tr "settings.biography_placeholder"}}" maxlength="255">{{.SignedUser.Description}}</textarea>
</div>
<div class="field {{if .Err_Website}}error{{end}}">
<label for="website">{{.locale.Tr "settings.website"}}</label>
- <input id="website" name="website" type="url" value="{{.SignedUser.Website}}">
+ <input id="website" name="website" type="url" value="{{.SignedUser.Website}}" maxlength="255">
</div>
<div class="field">
<label for="location">{{.locale.Tr "settings.location"}}</label>
- <input id="location" name="location" value="{{.SignedUser.Location}}">
+ <input id="location" name="location" value="{{.SignedUser.Location}}" maxlength="50">
</div>
<div class="ui divider"></div>