templates: Add ingredients page

This commit is contained in:
Tom Wiesing 2022-10-21 18:12:23 +02:00
parent d64e6f8ec3
commit 7a53703aaa
No known key found for this signature in database
17 changed files with 109 additions and 43 deletions

View file

@ -13,14 +13,14 @@ import (
"golang.org/x/sync/errgroup"
)
//go:embed "html/info_index.html"
//go:embed "html/index.html"
var indexTemplateStr string
var indexTemplate = static.AssetsControlIndex.MustParseShared(
"info_index.html",
"index.html",
indexTemplateStr,
)
type indexPageContext struct {
type indexContext struct {
Time time.Time
Config *config.Config
@ -34,7 +34,7 @@ type indexPageContext struct {
Backups []models.Export
}
func (nfo *Info) indexPageAPI(r *http.Request) (idx indexPageContext, err error) {
func (nfo *Info) index(r *http.Request) (idx indexContext, err error) {
var group errgroup.Group
group.Go(func() error {