{{block "search results for" .Query}}Search results for ‘{{.}}’{{end}}
+ {{if .MatchedHyphaName}} +{{block "go to hypha" .}}Go to hypha {{beautifulName .MatchedHyphaName}}.{{end}}
+ {{end}} {{if len .Results}}{{block "search desc" .}}Every hypha name has been compared with the query. Hyphae that have matched the query are listed below.{{end}}
-
diff --git a/misc/views.go b/misc/views.go
index 9c9f6ac..f19b495 100644
--- a/misc/views.go
+++ b/misc/views.go
@@ -15,8 +15,9 @@ var (
{{define "search:"}}Поиск:{{end}}
{{define "search results for"}}Результаты поиска для «{{.}}»{{end}}
{{define "search desc"}}Название каждой из существующих гиф сопоставлено с запросом. Подходящие гифы приведены ниже.{{end}}
-{{define "search no results"}}Ничего не найдено{{end}}
+{{define "search no results"}}Ничего не найдено.{{end}}
{{define "x total"}}{{.}} всего.{{end}}
+{{define "go to hypha"}}Перейти к гифе {{beautifulName .MatchedHyphaName}}.{{end}}
`
)
@@ -46,14 +47,18 @@ func viewList(meta viewutil.Meta, entries []listDatum) {
type titleSearchData struct {
*viewutil.BaseData
- Query string
- Results []string
+ Query string
+ Results []string
+ MatchedHyphaName string
+ HasExactMatch bool
}
-func viewTitleSearch(meta viewutil.Meta, query string, results []string) {
+func viewTitleSearch(meta viewutil.Meta, query string, hyphaName string, hasExactMatch bool, results []string) {
viewutil.ExecutePage(meta, chainTitleSearch, titleSearchData{
- BaseData: &viewutil.BaseData{},
- Query: query,
- Results: results,
+ BaseData: &viewutil.BaseData{},
+ Query: query,
+ Results: results,
+ MatchedHyphaName: hyphaName,
+ HasExactMatch: hasExactMatch,
})
}