1
0

Now index template is a variable.

This commit is contained in:
Alexander Andreev 2022-05-24 19:41:04 +04:00
parent d3cce3d0cb
commit 74ae6f4213
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -66,7 +66,7 @@ func (h *RadioHandlers) Index(w http.ResponseWriter, r *http.Request) {
} }
} }
if err := web.Template("index").Execute(w, &IndexData{ if err := web.IndexTemplate.Execute(w, &IndexData{
MainSite: utils.MainSite(r.Host), MainSite: utils.MainSite(r.Host),
Status: status, Status: status,
Songs: songs, Songs: songs,
@ -117,6 +117,6 @@ func (h *RadioHandlers) LastSong(w http.ResponseWriter, r *http.Request) {
func (h *RadioHandlers) Playlist(w http.ResponseWriter, _ *http.Request) { func (h *RadioHandlers) Playlist(w http.ResponseWriter, _ *http.Request) {
w.Header().Add("Content-Disposition", "attachment; filename=\"radio.arav.top.m3u\"") w.Header().Add("Content-Disposition", "attachment; filename=\"radio.arav.top.m3u\"")
fc, _ := web.AssetsGetFile("web/assets/radio.arav.top.m3u") fc, _ := web.AssetsGetFile("radio.arav.top.m3u")
w.Write(fc) w.Write(fc)
} }