mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-05 16:59:35 +00:00
1e7a6483b8
By using git's ability, end users (especially small instance users) do not need to enable the indexer, they could also benefit from the code searching feature. Fix #29996 ![image](https://github.com/go-gitea/gitea/assets/2114189/11b7e458-88a4-480d-b4d7-72ee59406dd1) ![image](https://github.com/go-gitea/gitea/assets/2114189/0fe777d5-c95c-4288-a818-0427680805b6) --------- Co-authored-by: silverwind <me@silverwind.io>
26 lines
888 B
Go HTML Template
26 lines
888 B
Go HTML Template
<form class="ui form ignore-dirty">
|
|
{{if not $.CodeIndexerDisabled}}
|
|
{{template "shared/search/combo_fuzzy" dict "Value" .Keyword "Disabled" .CodeIndexerUnavailable "IsFuzzy" .IsFuzzy "Placeholder" (ctx.Locale.Tr "search.code_kind")}}
|
|
{{else}}
|
|
{{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.code_kind")}}
|
|
{{end}}
|
|
</form>
|
|
<div class="divider"></div>
|
|
<div class="ui user list">
|
|
{{if .CodeIndexerUnavailable}}
|
|
<div class="ui error message">
|
|
<p>{{ctx.Locale.Tr "search.code_search_unavailable"}}</p>
|
|
</div>
|
|
{{else}}
|
|
{{if not .CodeIndexerEnabled}}
|
|
<div class="ui message">
|
|
<p>{{ctx.Locale.Tr "search.code_search_by_git_grep"}}</p>
|
|
</div>
|
|
{{end}}
|
|
{{if .SearchResults}}
|
|
{{template "shared/search/code/results" .}}
|
|
{{else if .Keyword}}
|
|
<div>{{ctx.Locale.Tr "search.no_results"}}</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|