diff options
author | Jui-Nan Lin <jnlinn@gmail.com> | 2021-01-27 18:00:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 12:00:35 +0200 |
commit | c10503afeccd5172ace7613094dd5fe1e0770c55 (patch) | |
tree | 5a39cbf125f38a3bc75eb77c689b03ed13efa44c /templates/repo/search.tmpl | |
parent | b2c20b68a08e23bc952402a553d59a4613188bd0 (diff) | |
download | gitea-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/repo/search.tmpl')
-rw-r--r-- | templates/repo/search.tmpl | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/templates/repo/search.tmpl b/templates/repo/search.tmpl index b66391a5ac..ab9e9be2d6 100644 --- a/templates/repo/search.tmpl +++ b/templates/repo/search.tmpl @@ -5,10 +5,20 @@ <div class="ui repo-search"> <form class="ui form ignore-dirty" method="get"> <div class="ui fluid action input"> - <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.search.search_repo"}}"> - <button class="ui button" type="submit"> - <i class="icon df ac jc">{{svg "octicon-search" 16}}</i> - </button> + <div class="twelve wide field"> + <input name="q" value="{{.Keyword}}" placeholder="{{.i18n.Tr "repo.search.search_repo"}}"> + </div> + <div class="two wide field"> + <select name="t"> + <option value="">{{.i18n.Tr "repo.search.fuzzy"}}</option> + <option value="match" {{if eq .queryType "match"}}selected{{end}}>{{.i18n.Tr "repo.search.match"}}</option> + </select> + </div> + <div class="three field"> + <button class="ui button" type="submit"> + <i class="icon df ac jc">{{svg "octicon-search" 16}}</i> + </button> + </div> </div> </form> </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="{{EscapePound $.SourcePath}}/search?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="{{EscapePound $.SourcePath}}/search?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> |