summaryrefslogtreecommitdiffstats
path: root/templates/user/code.tmpl
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2022-10-11 02:12:03 +0300
committerGitHub <noreply@github.com>2022-10-11 00:12:03 +0100
commitb59b0cad0a550223f74add109ff13c0d2f4309f3 (patch)
tree4c4d0482ca8740390b5939c3979d1fef35cb9047 /templates/user/code.tmpl
parent3ccebf7f4044b85eef975e4544785893da763bd2 (diff)
downloadgitea-b59b0cad0a550223f74add109ff13c0d2f4309f3.tar.gz
gitea-b59b0cad0a550223f74add109ff13c0d2f4309f3.zip
Add user/organization code search (#19977)
Fixes #19925 Screenshots: ![attels](https://user-images.githubusercontent.com/165205/173864718-fe789429-55bc-4cad-808c-9f02f335cddf.png)
Diffstat (limited to 'templates/user/code.tmpl')
-rw-r--r--templates/user/code.tmpl25
1 files changed, 25 insertions, 0 deletions
diff --git a/templates/user/code.tmpl b/templates/user/code.tmpl
new file mode 100644
index 0000000000..730d4dc9eb
--- /dev/null
+++ b/templates/user/code.tmpl
@@ -0,0 +1,25 @@
+{{template "base/head" .}}
+<div class="page-content repository code-search">
+ {{template "user/overview/header" .}}
+ <div class="ui container">
+ {{template "code/searchform" .}}
+ <div class="ui divider"></div>
+ <div class="ui user list">
+ {{if .CodeIndexerUnavailable }}
+ <div class="ui error message">
+ <p>{{$.locale.Tr "explore.code_search_unavailable"}}</p>
+ </div>
+ {{else if .SearchResults}}
+ <h3>
+ {{.locale.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html }}
+ </h3>
+ {{template "code/searchresults" .}}
+ {{else if .Keyword}}
+ <div>{{$.locale.Tr "explore.code_no_results"}}</div>
+ {{end}}
+ </div>
+
+ {{template "base/paginate" .}}
+ </div>
+</div>
+{{template "base/footer" .}}