0
0
mirror of https://github.com/rls-moe/nyx synced 2025-08-19 06:18:38 +00:00

Embedded Resources

This commit is contained in:
Tim Schuster
2017-03-15 14:33:27 +01:00
parent 477d3477df
commit 37ba7255fe
9 changed files with 257 additions and 43 deletions

View File

@@ -11,24 +11,18 @@ import (
"time"
)
var riceConf = rice.Config{
LocateOrder: []rice.LocateMethod{
rice.LocateWorkingDirectory,
rice.LocateEmbedded,
rice.LocateAppended,
},
}
var box = riceConf.MustFindBox("http/admin/res/")
var (
panelTmpl = template.New("admin/panel")
loginTmpl = template.New("admin/login")
statusTmpl = template.New("admin/status")
)
func init() {
func LoadTemplates() error {
var err error
box, err := rice.FindBox("res/")
if err != nil {
panic(err)
}
panelTmpl, err = panelTmpl.Parse(box.MustString("panel.html"))
if err != nil {
panic(err)

55
http/admin/rice-box.go Normal file

File diff suppressed because one or more lines are too long