mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
{{.CsrfTokenHtml}}
|
||||
<div class="field {{if .Err_UserName}}error{{end}}">
|
||||
<label for="user_name">{{.locale.Tr "username"}}</label>
|
||||
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}}>
|
||||
<input id="user_name" name="user_name" value="{{.User.Name}}" autofocus {{if not .User.IsLocal}}disabled{{end}} maxlength="40">
|
||||
</div>
|
||||
<!-- Types and name -->
|
||||
<div class="inline required field {{if .Err_LoginType}}error{{end}}">
|
||||
@@ -59,7 +59,7 @@
|
||||
</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="{{.User.FullName}}">
|
||||
<input id="full_name" name="full_name" value="{{.User.FullName}}" maxlength="100">
|
||||
</div>
|
||||
<div class="required field {{if .Err_Email}}error{{end}}">
|
||||
<label for="email">{{.locale.Tr "email"}}</label>
|
||||
@@ -72,18 +72,18 @@
|
||||
</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="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com">
|
||||
<input id="website" name="website" type="url" value="{{.User.Website}}" placeholder="e.g. http://mydomain.com or https://mydomain.com" maxlength="255">
|
||||
</div>
|
||||
<div class="field {{if .Err_Location}}error{{end}}">
|
||||
<label for="location">{{.locale.Tr "settings.location"}}</label>
|
||||
<input id="location" name="location" value="{{.User.Location}}">
|
||||
<input id="location" name="location" value="{{.User.Location}}" maxlength="50">
|
||||
</div>
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<div class="inline field {{if .Err_MaxRepoCreation}}error{{end}}">
|
||||
<label for="max_repo_creation">{{.locale.Tr "admin.users.max_repo_creation"}}</label>
|
||||
<input id="max_repo_creation" name="max_repo_creation" type="number" value="{{.User.MaxRepoCreation}}">
|
||||
<input id="max_repo_creation" name="max_repo_creation" type="number" min="-1" value="{{.User.MaxRepoCreation}}">
|
||||
<p class="help">{{.locale.Tr "admin.users.max_repo_creation_desc"}}</p>
|
||||
</div>
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
<div class="inline field">
|
||||
<label for="avatar">{{.locale.Tr "settings.choose_new_avatar"}}</label>
|
||||
<input name="avatar" type="file" >
|
||||
<input name="avatar" type="file" accept="image/png,image/jpeg,image/gif,image/webp">
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
|
@@ -53,7 +53,7 @@
|
||||
</div>
|
||||
<div class="required field {{if .Err_UserName}}error{{end}}">
|
||||
<label for="user_name">{{.locale.Tr "username"}}</label>
|
||||
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
|
||||
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required maxlength="40">
|
||||
</div>
|
||||
<div class="required field {{if .Err_Email}}error{{end}}">
|
||||
<label for="email">{{.locale.Tr "email"}}</label>
|
||||
|
Reference in New Issue
Block a user