From 9e5d0a09eb7370daedb1cf572d25ffa150eacf17 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 16 Mar 2018 22:04:33 +0800 Subject: Global code search support (#3664) * add global code search on explore * fix bug when no anyone public repos * change the icon * fix typo and add UnitTypeCode check for login non-admin user * fix ui description when no match --- templates/explore/code.tmpl | 55 +++++++++++++++++++++++++++++++++++++++++++ templates/explore/navbar.tmpl | 5 ++++ 2 files changed, 60 insertions(+) create mode 100644 templates/explore/code.tmpl (limited to 'templates') diff --git a/templates/explore/code.tmpl b/templates/explore/code.tmpl new file mode 100644 index 0000000000..6003486213 --- /dev/null +++ b/templates/explore/code.tmpl @@ -0,0 +1,55 @@ +{{template "base/head" .}} +
+ {{template "explore/navbar" .}} +
+
+
+ + + +
+
+
+ +
+ {{if .SearchResults}} +

+ {{.i18n.Tr "explore.code_search_results" (.Keyword|Escape) | Str2html }} +

+ + {{else}} +
{{$.i18n.Tr "explore.code_no_results"}}
+ {{end}} +
+ + {{template "base/paginate" .}} +
+
+{{template "base/footer" .}} + diff --git a/templates/explore/navbar.tmpl b/templates/explore/navbar.tmpl index aa4a21d590..3bd52645e2 100644 --- a/templates/explore/navbar.tmpl +++ b/templates/explore/navbar.tmpl @@ -8,4 +8,9 @@ {{.i18n.Tr "explore.organizations"}} + {{if .IsRepoIndexerEnabled}} + + {{.i18n.Tr "explore.code"}} + + {{end}} -- cgit v1.2.3