templates: Add ingredients page
This commit is contained in:
parent
d64e6f8ec3
commit
7a53703aaa
17 changed files with 109 additions and 43 deletions
|
|
@ -13,21 +13,21 @@ import (
|
|||
"github.com/FAU-CDI/wisski-distillery/pkg/httpx"
|
||||
)
|
||||
|
||||
//go:embed "html/info_instance.html"
|
||||
//go:embed "html/instance.html"
|
||||
var instanceTemplateString string
|
||||
var instanceTemplate = static.AssetsControlInstance.MustParseShared(
|
||||
"info_instance.html",
|
||||
"instance.html",
|
||||
instanceTemplateString,
|
||||
)
|
||||
|
||||
type instancePageContext struct {
|
||||
type instanceContext struct {
|
||||
Time time.Time
|
||||
|
||||
Instance models.Instance
|
||||
Info info.WissKIInfo
|
||||
}
|
||||
|
||||
func (info *Info) instancePageAPI(r *http.Request) (is instancePageContext, err error) {
|
||||
func (info *Info) instance(r *http.Request) (is instanceContext, err error) {
|
||||
// find the slug as the last component of path!
|
||||
slug := strings.TrimSuffix(r.URL.Path, "/")
|
||||
slug = slug[strings.LastIndex(slug, "/")+1:]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue