aboutsummaryrefslogtreecommitdiffstats
path: root/templates/explore
diff options
context:
space:
mode:
authorJui-Nan Lin <jnlinn@gmail.com>2021-01-27 18:00:35 +0800
committerGitHub <noreply@github.com>2021-01-27 12:00:35 +0200
commitc10503afeccd5172ace7613094dd5fe1e0770c55 (patch)
tree5a39cbf125f38a3bc75eb77c689b03ed13efa44c /templates/explore
parentb2c20b68a08e23bc952402a553d59a4613188bd0 (diff)
downloadgitea-c10503afeccd5172ace7613094dd5fe1e0770c55.tar.gz
gitea-c10503afeccd5172ace7613094dd5fe1e0770c55.zip
[Feature] add precise search type for Elastic Search (#12869)
* feat: add type query parameters for specifying precise search * feat: add select dropdown in search box Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/explore')
-rw-r--r--templates/explore/code.tmpl13
1 files changed, 11 insertions, 2 deletions
diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl
index 1c41dd843f..2465663a60 100644
--- a/templates/explore/code.tmpl
+++ b/templates/explore/code.tmpl
@@ -5,9 +5,19 @@
<form class="ui form ignore-dirty" style="max-width: 100%">
<input type="hidden" name="tab" value="{{$.TabName}}">
<div class="ui fluid action input">
+ <div class="twelve wide field">
<input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
+ </div>
+ <div class="two wide field">
+ <select name="t">
+ <option value="">{{.i18n.Tr "explore.search.fuzzy"}}</option>
+ <option value="match" {{if eq .queryType "match"}}selected{{end}}>{{.i18n.Tr "explore.search.match"}}</option>
+ </select>
+ </div>
+ <div class="three field">
<button class="ui blue button">{{.i18n.Tr "explore.search"}}</button>
</div>
+ </div>
</form>
<div class="ui divider"></div>
@@ -18,7 +28,7 @@
</h3>
<div class="df ac fw">
{{range $term := .SearchResultLanguages}}
- <a class="ui text-label df ac mr-1 my-1 {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{AppSubUrl}}/explore/code?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}">
+ <a class="ui text-label df ac mr-1 my-1 {{if eq $.Language $term.Language}}primary {{end}}basic label" href="{{AppSubUrl}}/explore/code?q={{$.Keyword}}{{if ne $.Language $term.Language}}&l={{$term.Language}}{{end}}{{if ne $.queryType ""}}&t={{$.queryType}}{{end}}">
<i class="color-icon mr-3" style="background-color: {{$term.Color}}"></i>
{{$term.Language}}
<div class="detail">{{$term.Count}}</div>
@@ -62,4 +72,3 @@
</div>
</div>
{{template "base/footer" .}}
-