aboutsummaryrefslogtreecommitdiffstats
path: root/templates/explore
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/explore
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/explore')
-rw-r--r--templates/explore/repo_search.tmpl4
-rw-r--r--templates/explore/search.tmpl4
2 files changed, 4 insertions, 4 deletions
diff --git a/templates/explore/repo_search.tmpl b/templates/explore/repo_search.tmpl
index 85c1be8e6e..4c72affea0 100644
--- a/templates/explore/repo_search.tmpl
+++ b/templates/explore/repo_search.tmpl
@@ -21,11 +21,11 @@
</div>
</div>
</div>
-<form class="ui form ignore-dirty" style="max-width: 90%">
+<form class="ui form ignore-dirty">
<input type="hidden" name="sort" value="{{$.SortType}}">
<input type="hidden" name="language" value="{{$.Language}}">
<div class="ui fluid action input">
- <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}…" autofocus>
+ {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
{{if .PageIsExploreRepositories}}
<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">
{{end}}
diff --git a/templates/explore/search.tmpl b/templates/explore/search.tmpl
index 72dee41f0f..70780648b2 100644
--- a/templates/explore/search.tmpl
+++ b/templates/explore/search.tmpl
@@ -15,9 +15,9 @@
</div>
</div>
</div>
-<form class="ui form ignore-dirty" style="max-width: 90%">
+<form class="ui form ignore-dirty">
<div class="ui fluid action input">
- <input name="q" value="{{.Keyword}}" placeholder="{{.locale.Tr "explore.search"}}…" autofocus>
+ {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
<button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
</div>
</form>