2026-01-08 16:05:50 +00:00
|
|
|
package publicreport
|
2026-01-07 18:36:20 +00:00
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"embed"
|
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/htmlpage"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
//go:embed template/*
|
|
|
|
|
var embeddedFiles embed.FS
|
|
|
|
|
|
2026-01-14 18:21:56 +00:00
|
|
|
var components = [...]string{"footer", "photo-upload", "photo-upload-header"}
|
2026-01-07 18:36:20 +00:00
|
|
|
|
|
|
|
|
func buildTemplate(files ...string) *htmlpage.BuiltTemplate {
|
2026-01-08 16:05:50 +00:00
|
|
|
subdir := "public-report"
|
2026-01-07 18:36:20 +00:00
|
|
|
full_files := make([]string, 0)
|
|
|
|
|
for _, f := range files {
|
|
|
|
|
full_files = append(full_files, fmt.Sprintf("%s/template/%s.html", subdir, f))
|
|
|
|
|
}
|
|
|
|
|
for _, c := range components {
|
2026-01-07 21:47:33 +00:00
|
|
|
full_files = append(full_files, fmt.Sprintf("%s/template/component/%s.html", subdir, c))
|
2026-01-07 18:36:20 +00:00
|
|
|
}
|
2026-01-08 16:05:50 +00:00
|
|
|
return htmlpage.NewBuiltTemplate(embeddedFiles, "public-report/", full_files...)
|
2026-01-07 18:36:20 +00:00
|
|
|
}
|