diff options
author | silverwind <me@silverwind.io> | 2023-06-22 12:27:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-22 10:27:35 +0000 |
commit | af094fbb6c066ba2e02b812dc3e5875d46e0db42 (patch) | |
tree | f3d45e5337ee8bf8e94730295338f4e42dd614ed /templates/shared | |
parent | ff90c87c878b03e7beabac5f19396e0db2c25a1e (diff) | |
download | gitea-af094fbb6c066ba2e02b812dc3e5875d46e0db42.tar.gz gitea-af094fbb6c066ba2e02b812dc3e5875d46e0db42.zip |
Introduce shared template for search inputs (#25338)
- Set
[type=search](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/search)
- Disable spellcheck
- Set maxLength 255 that I found in `templates/repo/issue/search.tmpl`
- Remove unnecessary `max-width`, it does nothing
---------
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'templates/shared')
-rw-r--r-- | templates/shared/actions/runner_list.tmpl | 4 | ||||
-rw-r--r-- | templates/shared/searchinput.tmpl | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/templates/shared/actions/runner_list.tmpl b/templates/shared/actions/runner_list.tmpl index 5da55f44bb..36210af6d8 100644 --- a/templates/shared/actions/runner_list.tmpl +++ b/templates/shared/actions/runner_list.tmpl @@ -35,8 +35,8 @@ <div class="ui attached segment"> <form class="ui form ignore-dirty" id="user-list-search-form" action="{{$.Link}}"> <!-- Search Text --> - <div class="ui fluid action input" style="max-width: 70%;"> - <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}..." autofocus> + <div class="ui fluid action input"> + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}} <button class="ui primary button">{{.locale.Tr "explore.search"}}</button> </div> </form> diff --git a/templates/shared/searchinput.tmpl b/templates/shared/searchinput.tmpl new file mode 100644 index 0000000000..aae5437b12 --- /dev/null +++ b/templates/shared/searchinput.tmpl @@ -0,0 +1 @@ +<input type="search" spellcheck="false" name="q" maxlength="255" placeholder="{{.locale.Tr "explore.search"}}…"{{if .Value}} value="{{.Value}}"{{end}}{{if .AutoFocus}} autofocus{{end}}{{if .Disabled}} disabled{{end}}> |