mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-07-05 19:12:49 +00:00
Hypha list: Return the hypha count
This commit is contained in:
parent
81e67b419a
commit
b7b8e26e3f
@ -3,6 +3,7 @@
|
|||||||
{{define "body"}}
|
{{define "body"}}
|
||||||
<main class="main-width">
|
<main class="main-width">
|
||||||
<h1>{{template "list of hyphae"}}</h1>
|
<h1>{{template "list of hyphae"}}</h1>
|
||||||
|
<p>{{block "x total" .HyphaCount}}{{.}} total.{{end}}</p>
|
||||||
<ol>
|
<ol>
|
||||||
{{range .Entries}}
|
{{range .Entries}}
|
||||||
<li>
|
<li>
|
||||||
|
@ -2,6 +2,7 @@ package misc
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/hyphae"
|
||||||
"github.com/bouncepaw/mycorrhiza/viewutil"
|
"github.com/bouncepaw/mycorrhiza/viewutil"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ var (
|
|||||||
{{define "search results for"}}Результаты поиска для «{{.}}»{{end}}
|
{{define "search results for"}}Результаты поиска для «{{.}}»{{end}}
|
||||||
{{define "search desc"}}Название каждой из существующих гиф сопоставлено с запросом. Подходящие гифы приведены ниже.{{end}}
|
{{define "search desc"}}Название каждой из существующих гиф сопоставлено с запросом. Подходящие гифы приведены ниже.{{end}}
|
||||||
{{define "search no results"}}Ничего не найдено{{end}}
|
{{define "search no results"}}Ничего не найдено{{end}}
|
||||||
|
{{define "x total"}}{{.}} всего.{{end}}
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -30,13 +32,15 @@ type listDatum struct {
|
|||||||
|
|
||||||
type listData struct {
|
type listData struct {
|
||||||
*viewutil.BaseData
|
*viewutil.BaseData
|
||||||
Entries []listDatum
|
Entries []listDatum
|
||||||
|
HyphaCount int
|
||||||
}
|
}
|
||||||
|
|
||||||
func viewList(meta viewutil.Meta, entries []listDatum) {
|
func viewList(meta viewutil.Meta, entries []listDatum) {
|
||||||
viewutil.ExecutePage(meta, chainList, listData{
|
viewutil.ExecutePage(meta, chainList, listData{
|
||||||
BaseData: &viewutil.BaseData{},
|
BaseData: &viewutil.BaseData{},
|
||||||
Entries: entries,
|
Entries: entries,
|
||||||
|
HyphaCount: hyphae.Count(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user