From dd136858f1ea40ad3c94191d647487fa4f31926c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.0. Signed-off-by: Daniel Baumann --- templates/shared/search/button.tmpl | 3 +++ templates/shared/search/code/results.tmpl | 44 +++++++++++++++++++++++++++++++ templates/shared/search/code/search.tmpl | 28 ++++++++++++++++++++ templates/shared/search/combo.tmpl | 8 ++++++ templates/shared/search/combo_fuzzy.tmpl | 15 +++++++++++ templates/shared/search/fuzzy.tmpl | 21 +++++++++++++++ templates/shared/search/input.tmpl | 4 +++ 7 files changed, 123 insertions(+) create mode 100644 templates/shared/search/button.tmpl create mode 100644 templates/shared/search/code/results.tmpl create mode 100644 templates/shared/search/code/search.tmpl create mode 100644 templates/shared/search/combo.tmpl create mode 100644 templates/shared/search/combo_fuzzy.tmpl create mode 100644 templates/shared/search/fuzzy.tmpl create mode 100644 templates/shared/search/input.tmpl (limited to 'templates/shared/search') diff --git a/templates/shared/search/button.tmpl b/templates/shared/search/button.tmpl new file mode 100644 index 0000000..7bb1662 --- /dev/null +++ b/templates/shared/search/button.tmpl @@ -0,0 +1,3 @@ +{{/* Disable (optional) - if search button has to be disabled */}} +{{/* Tooltip (optional) - a tooltip to be displayed on hover */}} + diff --git a/templates/shared/search/code/results.tmpl b/templates/shared/search/code/results.tmpl new file mode 100644 index 0000000..fe37557 --- /dev/null +++ b/templates/shared/search/code/results.tmpl @@ -0,0 +1,44 @@ +
+ {{range $term := .SearchResultLanguages}} + + + {{$term.Language}} +
{{$term.Count}}
+
+ {{end}} +
+ +{{template "base/paginate" .}} diff --git a/templates/shared/search/code/search.tmpl b/templates/shared/search/code/search.tmpl new file mode 100644 index 0000000..6a52bb9 --- /dev/null +++ b/templates/shared/search/code/search.tmpl @@ -0,0 +1,28 @@ +
+ {{template "shared/search/combo_fuzzy" + dict + "Value" .Keyword + "Disabled" .CodeIndexerUnavailable + "IsFuzzy" .IsFuzzy + "Placeholder" (ctx.Locale.Tr "search.code_kind") + "CodeIndexerDisabled" $.CodeIndexerDisabled}} +
+
+
+ {{if .CodeIndexerUnavailable}} +
+

{{ctx.Locale.Tr "search.code_search_unavailable"}}

+
+ {{else}} + {{if .CodeIndexerDisabled}} +
+

{{ctx.Locale.Tr "search.code_search_by_git_grep"}}

+
+ {{end}} + {{if .SearchResults}} + {{template "shared/search/code/results" .}} + {{else if .Keyword}} +
{{ctx.Locale.Tr "search.no_results"}}
+ {{end}} + {{end}} +
diff --git a/templates/shared/search/combo.tmpl b/templates/shared/search/combo.tmpl new file mode 100644 index 0000000..788db95 --- /dev/null +++ b/templates/shared/search/combo.tmpl @@ -0,0 +1,8 @@ +{{/* Value - value of the search field (for search results page) */}} +{{/* Disabled (optional) - if search field/button has to be disabled */}} +{{/* Placeholder (optional) - placeholder text to be used */}} +{{/* Tooltip (optional) - a tooltip to be displayed on button hover */}} +
+ {{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}} + {{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}} +
diff --git a/templates/shared/search/combo_fuzzy.tmpl b/templates/shared/search/combo_fuzzy.tmpl new file mode 100644 index 0000000..38189b0 --- /dev/null +++ b/templates/shared/search/combo_fuzzy.tmpl @@ -0,0 +1,15 @@ +{{/* Value - value of the search field (for search results page) */}} +{{/* Disabled (optional) - if search field/button has to be disabled */}} +{{/* Placeholder (optional) - placeholder text to be used */}} +{{/* IsFuzzy - state of the fuzzy/union search toggle */}} +{{/* CodeIndexerDisabled (optional) - if the performed search is done using git-grep */}} +{{/* Tooltip (optional) - a tooltip to be displayed on button hover */}} +
+ {{template "shared/search/input" dict "Value" .Value "Disabled" .Disabled "Placeholder" .Placeholder}} + {{template "shared/search/fuzzy" + dict + "Disabled" .Disabled + "IsFuzzy" .IsFuzzy + "CodeIndexerDisabled" .CodeIndexerDisabled}} + {{template "shared/search/button" dict "Disabled" .Disabled "Tooltip" .Tooltip}} +
diff --git a/templates/shared/search/fuzzy.tmpl b/templates/shared/search/fuzzy.tmpl new file mode 100644 index 0000000..25cfc57 --- /dev/null +++ b/templates/shared/search/fuzzy.tmpl @@ -0,0 +1,21 @@ +{{/* Disabled (optional) - if dropdown has to be disabled */}} +{{/* IsFuzzy - state of the fuzzy search toggle */}} + diff --git a/templates/shared/search/input.tmpl b/templates/shared/search/input.tmpl new file mode 100644 index 0000000..195cefc --- /dev/null +++ b/templates/shared/search/input.tmpl @@ -0,0 +1,4 @@ +{{/* Value - value of the search field (for search results page) */}} +{{/* Disabled (optional) - if search field has to be disabled */}} +{{/* Placeholder (optional) - placeholder text to be used */}} + -- cgit v1.2.3