aboutsummaryrefslogtreecommitdiffstats
path: root/templates/shared
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-06-22 12:27:35 +0200
committerGitHub <noreply@github.com>2023-06-22 10:27:35 +0000
commitaf094fbb6c066ba2e02b812dc3e5875d46e0db42 (patch)
treef3d45e5337ee8bf8e94730295338f4e42dd614ed /templates/shared
parentff90c87c878b03e7beabac5f19396e0db2c25a1e (diff)
downloadgitea-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.tmpl4
-rw-r--r--templates/shared/searchinput.tmpl1
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}}>