2026-06-18 01:40:12 +00:00
|
|
|
package web
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"embed"
|
|
|
|
|
"html/template"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//go:embed templates/*.html
|
|
|
|
|
var templatesFS embed.FS
|
|
|
|
|
|
|
|
|
|
//go:embed static/*
|
|
|
|
|
var staticFS embed.FS
|
|
|
|
|
|
|
|
|
|
// parsePage parses the shared base layout together with a single page template,
|
|
|
|
|
// yielding a template set whose "base" definition renders the full document.
|
|
|
|
|
func parsePage(name string) *template.Template {
|
|
|
|
|
return template.Must(template.ParseFS(templatesFS, "templates/base.html", "templates/"+name))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
uploadPage = parsePage("upload.html")
|
|
|
|
|
confirmPage = parsePage("confirm.html")
|
|
|
|
|
managePage = parsePage("manage.html")
|
|
|
|
|
exportPage = parsePage("export.html")
|
2026-06-19 02:04:42 +00:00
|
|
|
tallyPage = parsePage("tally.html")
|
|
|
|
|
recentPage = parsePage("recent.html")
|
2026-06-18 01:40:12 +00:00
|
|
|
)
|