1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-04-06 18:57:04 +00:00

Hypha list: Return the hypha count

This commit is contained in:
Timur Ismagilov 2022-07-11 14:03:07 +05:00
parent 81e67b419a
commit b7b8e26e3f
2 changed files with 8 additions and 3 deletions

View File

@ -3,6 +3,7 @@
{{define "body"}}
<main class="main-width">
<h1>{{template "list of hyphae"}}</h1>
<p>{{block "x total" .HyphaCount}}{{.}} total.{{end}}</p>
<ol>
{{range .Entries}}
<li>

View File

@ -2,6 +2,7 @@ package misc
import (
"embed"
"github.com/bouncepaw/mycorrhiza/hyphae"
"github.com/bouncepaw/mycorrhiza/viewutil"
)
@ -15,6 +16,7 @@ var (
{{define "search results for"}}Результаты поиска для «{{.}}»{{end}}
{{define "search desc"}}Название каждой из существующих гиф сопоставлено с запросом. Подходящие гифы приведены ниже.{{end}}
{{define "search no results"}}Ничего не найдено{{end}}
{{define "x total"}}{{.}} всего.{{end}}
`
)
@ -30,13 +32,15 @@ type listDatum struct {
type listData struct {
*viewutil.BaseData
Entries []listDatum
Entries []listDatum
HyphaCount int
}
func viewList(meta viewutil.Meta, entries []listDatum) {
viewutil.ExecutePage(meta, chainList, listData{
BaseData: &viewutil.BaseData{},
Entries: entries,
BaseData: &viewutil.BaseData{},
Entries: entries,
HyphaCount: hyphae.Count(),
})
}