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:
parent
81e67b419a
commit
b7b8e26e3f
@ -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>
|
||||
|
@ -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(),
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user