diff --git a/website/main.go b/website/main.go index 6f6f0604..a007e9bf 100644 --- a/website/main.go +++ b/website/main.go @@ -135,13 +135,12 @@ func Execute(ctx context.Context, cfg config.Config) error { // public routes r.Route("/", public.Route(ctx, public.State{ - Config: cfg, - Daypass: dpass, - Templates: siteTemplates, - TemplateExecutor: siteTemplates.Executor(), - Manager: manager, - Streamer: streamer, - Storage: storage, + Config: cfg, + Daypass: dpass, + Templates: siteTemplates.Executor(), + Manager: manager, + Streamer: streamer, + Storage: storage, })) // setup the http server diff --git a/website/public/chat.go b/website/public/chat.go index 793fe814..5fce045c 100644 --- a/website/public/chat.go +++ b/website/public/chat.go @@ -21,7 +21,7 @@ func NewChatInput(r *http.Request) ChatInput { func (s State) GetChat(w http.ResponseWriter, r *http.Request) { input := NewChatInput(r) - err := s.TemplateExecutor.Execute(w, r, input) + err := s.Templates.Execute(w, r, input) if err != nil { s.errorHandler(w, r, err) return diff --git a/website/public/faves.go b/website/public/faves.go index e8738b0c..35b4256d 100644 --- a/website/public/faves.go +++ b/website/public/faves.go @@ -21,7 +21,7 @@ func NewFavesInput(r *http.Request) FavesInput { func (s State) GetFaves(w http.ResponseWriter, r *http.Request) { input := NewFavesInput(r) - err := s.TemplateExecutor.Execute(w, r, input) + err := s.Templates.Execute(w, r, input) if err != nil { s.errorHandler(w, r, err) return diff --git a/website/public/home.go b/website/public/home.go index c9625db4..dd3bc638 100644 --- a/website/public/home.go +++ b/website/public/home.go @@ -65,5 +65,5 @@ func (s State) getHome(w http.ResponseWriter, r *http.Request) error { } input.News = news.Entries - return s.TemplateExecutor.Execute(w, r, input) + return s.Templates.Execute(w, r, input) } diff --git a/website/public/lastplayed.go b/website/public/lastplayed.go index 13751465..b4df70ad 100644 --- a/website/public/lastplayed.go +++ b/website/public/lastplayed.go @@ -47,7 +47,7 @@ func (s State) getLastPlayed(w http.ResponseWriter, r *http.Request) error { return err } - return s.TemplateExecutor.Execute(w, r, input) + return s.Templates.Execute(w, r, input) } func (s State) GetLastPlayed(w http.ResponseWriter, r *http.Request) { diff --git a/website/public/news.go b/website/public/news.go index 2f1731ca..d18cc743 100644 --- a/website/public/news.go +++ b/website/public/news.go @@ -35,7 +35,7 @@ func (s State) GetNews(w http.ResponseWriter, r *http.Request) { return } - err = s.TemplateExecutor.Execute(w, r, input) + err = s.Templates.Execute(w, r, input) if err != nil { s.errorHandler(w, r, err) return diff --git a/website/public/queue.go b/website/public/queue.go index c13697cd..856c1b7e 100644 --- a/website/public/queue.go +++ b/website/public/queue.go @@ -34,7 +34,7 @@ func (s State) getQueue(w http.ResponseWriter, r *http.Request) error { return err } - return s.TemplateExecutor.Execute(w, r, input) + return s.Templates.Execute(w, r, input) } func (s State) GetQueue(w http.ResponseWriter, r *http.Request) { diff --git a/website/public/schedule.go b/website/public/schedule.go index e61379f5..1e79ea9e 100644 --- a/website/public/schedule.go +++ b/website/public/schedule.go @@ -33,5 +33,5 @@ func (s State) getSchedule(w http.ResponseWriter, r *http.Request) error { input := NewScheduleInput(r) - return s.TemplateExecutor.Execute(w, r, input) + return s.Templates.Execute(w, r, input) } diff --git a/website/public/search.go b/website/public/search.go index 63ffb997..ed2dada9 100644 --- a/website/public/search.go +++ b/website/public/search.go @@ -21,7 +21,7 @@ func (SearchInput) TemplateBundle() string { func (s State) GetSearch(w http.ResponseWriter, r *http.Request) { input := NewSearchInput(r) - err := s.TemplateExecutor.Execute(w, r, input) + err := s.Templates.Execute(w, r, input) if err != nil { s.errorHandler(w, r, err) return diff --git a/website/public/staff.go b/website/public/staff.go index 127920d6..766aa5f7 100644 --- a/website/public/staff.go +++ b/website/public/staff.go @@ -21,7 +21,7 @@ func (StaffInput) TemplateBundle() string { func (s State) GetStaff(w http.ResponseWriter, r *http.Request) { input := NewStaffInput(r) - err := s.TemplateExecutor.Execute(w, r, input) + err := s.Templates.Execute(w, r, input) if err != nil { s.errorHandler(w, r, err) return diff --git a/website/public/state.go b/website/public/state.go index 7c8c8613..7d8372a4 100644 --- a/website/public/state.go +++ b/website/public/state.go @@ -19,12 +19,11 @@ const theme = "default" type State struct { config.Config - Daypass *daypass.Daypass - Templates *templates.Site - TemplateExecutor templates.Executor - Manager radio.ManagerService - Streamer radio.StreamerService - Storage radio.StorageService + Daypass *daypass.Daypass + Templates templates.Executor + Manager radio.ManagerService + Streamer radio.StreamerService + Storage radio.StorageService } func (s *State) errorHandler(w http.ResponseWriter, r *http.Request, err error) { diff --git a/website/public/submit.go b/website/public/submit.go index d7402b8a..29bf35a7 100644 --- a/website/public/submit.go +++ b/website/public/submit.go @@ -111,7 +111,7 @@ func (s State) getSubmit(w http.ResponseWriter, r *http.Request, form *Submissio return errors.E(op, err) } - return s.TemplateExecutor.Execute(w, r, input) + return s.Templates.Execute(w, r, input) } func (s State) PostSubmit(w http.ResponseWriter, r *http.Request) { @@ -119,7 +119,7 @@ func (s State) PostSubmit(w http.ResponseWriter, r *http.Request) { responseFn := func(form SubmissionForm) { var err error if IsHTMX(r) { - err = s.TemplateExecutor.Execute(w, r, form) + err = s.Templates.Execute(w, r, form) } else { err = s.getSubmit(w, r, &form) }