From af094fbb6c066ba2e02b812dc3e5875d46e0db42 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 22 Jun 2023 12:27:35 +0200 Subject: [PATCH] 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 Co-authored-by: Giteabot --- templates/admin/base/search.tmpl | 4 ++-- templates/admin/emails/list.tmpl | 4 ++-- templates/admin/packages/list.tmpl | 2 +- templates/admin/repo/search.tmpl | 4 ++-- templates/admin/user/list.tmpl | 4 ++-- templates/code/searchform.tmpl | 2 +- templates/explore/repo_search.tmpl | 4 ++-- templates/explore/search.tmpl | 4 ++-- templates/package/shared/list.tmpl | 2 +- templates/package/shared/versionlist.tmpl | 2 +- templates/repo/issue/milestones.tmpl | 2 +- templates/repo/issue/search.tmpl | 2 +- templates/shared/actions/runner_list.tmpl | 4 ++-- templates/shared/searchinput.tmpl | 1 + templates/user/dashboard/issues.tmpl | 2 +- templates/user/dashboard/milestones.tmpl | 2 +- web_src/js/components/DashboardRepoList.vue | 2 +- 17 files changed, 24 insertions(+), 23 deletions(-) create mode 100644 templates/shared/searchinput.tmpl diff --git a/templates/admin/base/search.tmpl b/templates/admin/base/search.tmpl index ae1a4d2ac5..bc684e7657 100644 --- a/templates/admin/base/search.tmpl +++ b/templates/admin/base/search.tmpl @@ -15,9 +15,9 @@ -
+
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
diff --git a/templates/admin/emails/list.tmpl b/templates/admin/emails/list.tmpl index 1da40cbf29..db15887d98 100644 --- a/templates/admin/emails/list.tmpl +++ b/templates/admin/emails/list.tmpl @@ -19,9 +19,9 @@ -
+
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
diff --git a/templates/admin/packages/list.tmpl b/templates/admin/packages/list.tmpl index f320878b80..a0b6fd9bb0 100644 --- a/templates/admin/packages/list.tmpl +++ b/templates/admin/packages/list.tmpl @@ -8,7 +8,7 @@
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
diff --git a/templates/admin/user/list.tmpl b/templates/admin/user/list.tmpl index 2f76f2d3ba..3093b0f47a 100644 --- a/templates/admin/user/list.tmpl +++ b/templates/admin/user/list.tmpl @@ -51,8 +51,8 @@
-
- +
+ {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
diff --git a/templates/code/searchform.tmpl b/templates/code/searchform.tmpl index dfe7bc5b10..822102fc70 100644 --- a/templates/code/searchform.tmpl +++ b/templates/code/searchform.tmpl @@ -1,6 +1,6 @@
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true "Disabled" .CodeIndexerUnavailable}}
- +
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}} {{if .PageIsExploreRepositories}} {{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 @@
- +
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
diff --git a/templates/package/shared/list.tmpl b/templates/package/shared/list.tmpl index 5ac5baf0f1..3d14eda3ef 100644 --- a/templates/package/shared/list.tmpl +++ b/templates/package/shared/list.tmpl @@ -2,7 +2,7 @@ {{template "base/alert" .}}
- + {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} + {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}} - + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword}} diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl index 13224680bd..ec7789b952 100644 --- a/templates/repo/issue/search.tmpl +++ b/templates/repo/issue/search.tmpl @@ -7,7 +7,7 @@ - + {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword}} {{if .PageIsIssueList}} {{end}} 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 @@
-
- +
+ {{template "shared/searchinput" dict "locale" .locale "Value" .Keyword "AutoFocus" true}}
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 @@ + diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl index e7762c5a93..528c9f4f9c 100644 --- a/templates/user/dashboard/issues.tmpl +++ b/templates/user/dashboard/issues.tmpl @@ -77,7 +77,7 @@ - + {{template "shared/searchinput" dict "locale" .locale "Value" $.Keyword}}
diff --git a/templates/user/dashboard/milestones.tmpl b/templates/user/dashboard/milestones.tmpl index c68d0783b8..43d145ac5e 100644 --- a/templates/user/dashboard/milestones.tmpl +++ b/templates/user/dashboard/milestones.tmpl @@ -51,7 +51,7 @@ - + {{template "shared/searchinput" dict "locale" .locale "Value" $.Keyword}}
diff --git a/web_src/js/components/DashboardRepoList.vue b/web_src/js/components/DashboardRepoList.vue index b47d872927..6d27cb7508 100644 --- a/web_src/js/components/DashboardRepoList.vue +++ b/web_src/js/components/DashboardRepoList.vue @@ -16,7 +16,7 @@