feat(frontend): add preferences page template and styles
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3dbde9fbfd
commit
b4053b7f98
3 changed files with 284 additions and 0 deletions
|
|
@ -92,6 +92,7 @@ var (
|
|||
tmplFull *template.Template
|
||||
tmplIndex *template.Template
|
||||
tmplFragment *template.Template
|
||||
tmplPreferences *template.Template
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
|
@ -111,6 +112,9 @@ func init() {
|
|||
tmplFragment = template.Must(template.New("").Funcs(funcMap).ParseFS(tmplFS,
|
||||
"results_inner.html", "result_item.html", "video_item.html",
|
||||
))
|
||||
tmplPreferences = template.Must(template.New("").Funcs(funcMap).ParseFS(tmplFS,
|
||||
"base.html", "preferences.html",
|
||||
))
|
||||
}
|
||||
|
||||
// StaticFS returns the embedded static file system for serving CSS/JS/images.
|
||||
|
|
@ -288,3 +292,9 @@ func RenderSearchAuto(w http.ResponseWriter, r *http.Request, data PageData) err
|
|||
return RenderSearch(w, data)
|
||||
}
|
||||
|
||||
// RenderPreferences renders the full preferences page.
|
||||
func RenderPreferences(w http.ResponseWriter, sourceURL string) error {
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||
return tmplPreferences.ExecuteTemplate(w, "base", PageData{ShowHeader: true, SourceURL: sourceURL})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue