mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-22 14:08:01 +02:00
Unify search boxes (#29530)
Unify all but a few search boxes to use uniform style, uniform translations and shared templates where possible. Remove a few duplicated search templates, e. g. code search. <details><summary>Example after screenshots:</summary>     </details> Also includes #29700 Co-authored-by: 6543 <6543@obermui.de> --------- Co-authored-by: 6543 <m.huber@kithara.com> Co-authored-by: 6543 <6543@obermui.de> Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
@ -34,12 +34,11 @@ func Code(ctx *context.Context) {
|
||||
language := ctx.FormTrim("l")
|
||||
keyword := ctx.FormTrim("q")
|
||||
|
||||
queryType := ctx.FormTrim("t")
|
||||
isFuzzy := queryType != "match"
|
||||
isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
|
||||
|
||||
ctx.Data["Keyword"] = keyword
|
||||
ctx.Data["Language"] = language
|
||||
ctx.Data["queryType"] = queryType
|
||||
ctx.Data["IsFuzzy"] = isFuzzy
|
||||
ctx.Data["PageIsViewCode"] = true
|
||||
|
||||
if keyword == "" {
|
||||
|
@ -203,7 +203,7 @@ func SearchCommits(ctx *context.Context) {
|
||||
|
||||
ctx.Data["Keyword"] = query
|
||||
if all {
|
||||
ctx.Data["All"] = "checked"
|
||||
ctx.Data["All"] = true
|
||||
}
|
||||
ctx.Data["Username"] = ctx.Repo.Owner.Name
|
||||
ctx.Data["Reponame"] = ctx.Repo.Repository.Name
|
||||
|
@ -24,12 +24,11 @@ func Search(ctx *context.Context) {
|
||||
language := ctx.FormTrim("l")
|
||||
keyword := ctx.FormTrim("q")
|
||||
|
||||
queryType := ctx.FormTrim("t")
|
||||
isFuzzy := queryType != "match"
|
||||
isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
|
||||
|
||||
ctx.Data["Keyword"] = keyword
|
||||
ctx.Data["Language"] = language
|
||||
ctx.Data["queryType"] = queryType
|
||||
ctx.Data["IsFuzzy"] = isFuzzy
|
||||
ctx.Data["PageIsViewCode"] = true
|
||||
|
||||
if keyword == "" {
|
||||
@ -54,7 +53,7 @@ func Search(ctx *context.Context) {
|
||||
ctx.Data["CodeIndexerUnavailable"] = !code_indexer.IsAvailable(ctx)
|
||||
}
|
||||
|
||||
ctx.Data["SourcePath"] = ctx.Repo.Repository.Link()
|
||||
ctx.Data["Repo"] = ctx.Repo.Repository
|
||||
ctx.Data["SearchResults"] = searchResults
|
||||
ctx.Data["SearchResultLanguages"] = searchResultLanguages
|
||||
|
||||
|
@ -39,12 +39,11 @@ func CodeSearch(ctx *context.Context) {
|
||||
language := ctx.FormTrim("l")
|
||||
keyword := ctx.FormTrim("q")
|
||||
|
||||
queryType := ctx.FormTrim("t")
|
||||
isFuzzy := queryType != "match"
|
||||
isFuzzy := ctx.FormOptionalBool("fuzzy").ValueOrDefault(true)
|
||||
|
||||
ctx.Data["Keyword"] = keyword
|
||||
ctx.Data["Language"] = language
|
||||
ctx.Data["queryType"] = queryType
|
||||
ctx.Data["IsFuzzy"] = isFuzzy
|
||||
ctx.Data["IsCodePage"] = true
|
||||
|
||||
if keyword == "" {
|
||||
|
Reference in New Issue
Block a user