diff options
author | JakobDev <jakobdev@gmx.de> | 2023-05-26 11:42:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 09:42:54 +0000 |
commit | 85fa954a3810b233cb299f455546c4b2314400b3 (patch) | |
tree | 9cf4b3955c59b6c38aba1b1df07d14843aaef375 /templates/repo | |
parent | 18f26cfbf7f9b36b838c0e8762bfba98c89b9797 (diff) | |
download | gitea-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/repo')
-rw-r--r-- | templates/repo/create.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/issue/search.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/migrate/codebase.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/git.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/gitbucket.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/gitea.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/github.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/gitlab.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/gogs.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/migrate/onedev.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/settings/options.tmpl | 2 |
11 files changed, 20 insertions, 20 deletions
diff --git a/templates/repo/create.tmpl b/templates/repo/create.tmpl index 85b02f394d..05e7052ff4 100644 --- a/templates/repo/create.tmpl +++ b/templates/repo/create.tmpl @@ -43,7 +43,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" autofocus required maxlength="100"> <span class="help">{{.locale.Tr "repo.repo_name_helper"}}</span> </div> <div class="inline field"> @@ -61,7 +61,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description" placeholder="{{.locale.Tr "repo.repo_desc_helper"}}">{{.description}}</textarea> + <textarea id="description" name="description" placeholder="{{.locale.Tr "repo.repo_desc_helper"}}" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> <label>{{.locale.Tr "repo.template"}}</label> diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl index f24c2dbb7e..97b22d3699 100644 --- a/templates/repo/issue/search.tmpl +++ b/templates/repo/issue/search.tmpl @@ -7,7 +7,7 @@ <input type="hidden" name="project" value="{{$.ProjectID}}"> <input type="hidden" name="assignee" value="{{$.AssigneeID}}"> <input type="hidden" name="poster" value="{{$.PosterID}}"> - <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..."> + <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." maxlength="255"> {{if .PageIsIssueList}} <button id="issue-list-quick-goto" class="ui small icon button gt-hidden" data-tooltip-content="{{.locale.Tr "explore.go_to"}}" data-repo-link="{{.RepoLink}}">{{svg "octicon-hash"}}</button> {{end}} diff --git a/templates/repo/migrate/codebase.tmpl b/templates/repo/migrate/codebase.tmpl index 5bfd3adc2d..41e9c273bc 100644 --- a/templates/repo/migrate/codebase.tmpl +++ b/templates/repo/migrate/codebase.tmpl @@ -83,7 +83,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -99,7 +99,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/git.tmpl b/templates/repo/migrate/git.tmpl index fb6775e38c..ba092a32a0 100644 --- a/templates/repo/migrate/git.tmpl +++ b/templates/repo/migrate/git.tmpl @@ -57,7 +57,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -73,7 +73,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/gitbucket.tmpl b/templates/repo/migrate/gitbucket.tmpl index e9515beeb2..da14d569a8 100644 --- a/templates/repo/migrate/gitbucket.tmpl +++ b/templates/repo/migrate/gitbucket.tmpl @@ -99,7 +99,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -115,7 +115,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/gitea.tmpl b/templates/repo/migrate/gitea.tmpl index f1d4e4f06b..daa1205557 100644 --- a/templates/repo/migrate/gitea.tmpl +++ b/templates/repo/migrate/gitea.tmpl @@ -95,7 +95,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -111,7 +111,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/github.tmpl b/templates/repo/migrate/github.tmpl index c591f2a465..e9f2b11e75 100644 --- a/templates/repo/migrate/github.tmpl +++ b/templates/repo/migrate/github.tmpl @@ -97,7 +97,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -113,7 +113,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/gitlab.tmpl b/templates/repo/migrate/gitlab.tmpl index 65559da152..656b5c50ee 100644 --- a/templates/repo/migrate/gitlab.tmpl +++ b/templates/repo/migrate/gitlab.tmpl @@ -94,7 +94,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -110,7 +110,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/gogs.tmpl b/templates/repo/migrate/gogs.tmpl index 8bc57861ad..78700a7910 100644 --- a/templates/repo/migrate/gogs.tmpl +++ b/templates/repo/migrate/gogs.tmpl @@ -97,7 +97,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -113,7 +113,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/migrate/onedev.tmpl b/templates/repo/migrate/onedev.tmpl index 8463782ae7..50858edd60 100644 --- a/templates/repo/migrate/onedev.tmpl +++ b/templates/repo/migrate/onedev.tmpl @@ -83,7 +83,7 @@ <div class="inline required field {{if .Err_RepoName}}error{{end}}"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" value="{{.repo_name}}" required> + <input id="repo_name" name="repo_name" value="{{.repo_name}}" required maxlength="100"> </div> <div class="inline field"> <label>{{.locale.Tr "repo.visibility"}}</label> @@ -99,7 +99,7 @@ </div> <div class="inline field {{if .Err_Description}}error{{end}}"> <label for="description">{{.locale.Tr "repo.repo_desc"}}</label> - <textarea id="description" name="description">{{.description}}</textarea> + <textarea id="description" name="description" maxlength="2048">{{.description}}</textarea> </div> <div class="inline field"> diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl index efcdaceb37..83a6bc4ba1 100644 --- a/templates/repo/settings/options.tmpl +++ b/templates/repo/settings/options.tmpl @@ -826,7 +826,7 @@ </div> <div class="required field"> <label for="repo_name">{{.locale.Tr "repo.repo_name"}}</label> - <input id="repo_name" name="repo_name" required> + <input id="repo_name" name="repo_name" required maxlength="100"> </div> <div class="text right actions"> |