From fadbed1bcafcebfd68da62254a0eca79bc06eb41 Mon Sep 17 00:00:00 2001 From: Alyx BB Date: Sun, 5 Nov 2023 00:19:15 +0000 Subject: [PATCH 1/4] cleaned up index infobar --- controllers/index.go | 7 ++----- models/index.go | 8 +------- views/index.tmpl | 21 +++++---------------- 3 files changed, 8 insertions(+), 28 deletions(-) diff --git a/controllers/index.go b/controllers/index.go index f51e9cff..932adb26 100644 --- a/controllers/index.go +++ b/controllers/index.go @@ -19,7 +19,6 @@ type IndexController struct { type RenderData struct { CurrentAndNext *myradio.CurrentAndNext Banners []myradio.Banner - Teams []myradio.Team Timeslots []myradio.Timeslot Podcasts []myradio.Podcast MsgBoxError bool @@ -37,7 +36,7 @@ func (ic *IndexController) Get(w http.ResponseWriter, r *http.Request) { // This is where any form params would be parsed model := models.NewIndexModel(ic.session) - currentAndNext, banners, teams, timeslots, podcasts, showOnAir, err := model.Get() + currentAndNext, banners, timeslots, podcasts, showOnAir, err := model.Get() if err != nil { log.Println(err) @@ -47,7 +46,6 @@ func (ic *IndexController) Get(w http.ResponseWriter, r *http.Request) { data := RenderData{ CurrentAndNext: currentAndNext, Banners: banners, - Teams: teams, Timeslots: timeslots, Podcasts: podcasts, ShowOnAir: showOnAir, @@ -66,7 +64,7 @@ func (ic *IndexController) Post(w http.ResponseWriter, r *http.Request) { // Get all the data for the webpage model := models.NewIndexModel(ic.session) - currentAndNext, banners, teams, timeslots, podcasts, showOnAir, err := model.Get() + currentAndNext, banners, timeslots, podcasts, showOnAir, err := model.Get() if err != nil { log.Println(err) @@ -76,7 +74,6 @@ func (ic *IndexController) Post(w http.ResponseWriter, r *http.Request) { data := RenderData{ CurrentAndNext: currentAndNext, Banners: banners, - Teams: teams, Timeslots: timeslots, Podcasts: podcasts, ShowOnAir: showOnAir, diff --git a/models/index.go b/models/index.go index 56cf5744..f826e209 100644 --- a/models/index.go +++ b/models/index.go @@ -19,7 +19,7 @@ func NewIndexModel(s *myradio.Session) *IndexModel { // // On success, it returns the current and next show, and nil. // Otherwise, it returns undefined data and the error causing failure. -func (m *IndexModel) Get() (currentAndNext *myradio.CurrentAndNext, banners []myradio.Banner, teams []myradio.Team, timeslots []myradio.Timeslot, podcasts []myradio.Podcast, showOnAir bool, err error) { +func (m *IndexModel) Get() (currentAndNext *myradio.CurrentAndNext, banners []myradio.Banner, timeslots []myradio.Timeslot, podcasts []myradio.Podcast, showOnAir bool, err error) { currentAndNext, err = m.session.GetCurrentAndNext() if err != nil { return @@ -28,12 +28,6 @@ func (m *IndexModel) Get() (currentAndNext *myradio.CurrentAndNext, banners []my if err != nil { return } - - teams, err = m.session.GetCurrentTeams() - if err != nil { - return - } - timeslots, err = m.session.GetPreviousTimeslots(11) if err != nil { return diff --git a/views/index.tmpl b/views/index.tmpl index 440e2783..e56d2498 100644 --- a/views/index.tmpl +++ b/views/index.tmpl @@ -28,26 +28,15 @@
-
+
{{template "message_box" .}}
-
+

Get Involved


-
-
-

University Radio York has been alive since 1968, when we became the first legal independent radio station in the UK!

-

Help us continue our legacy by joining the URY team.

-

Contact our teams to find out more.

-
-
- -
-
+

University Radio York has been alive since 1968, when we became the first legal independent radio station in the UK!

+

Help us continue our legacy by joining the URY team.

+

find out more

From 6b13d1555b8e6238228c1de587947369eae43af8 Mon Sep 17 00:00:00 2001 From: Alyx BB Date: Sun, 5 Nov 2023 00:59:27 +0000 Subject: [PATCH 2/4] yeet sessions --- public/js/index.js | 14 -------------- views/index.tmpl | 5 ----- 2 files changed, 19 deletions(-) diff --git a/public/js/index.js b/public/js/index.js index f5a8eb65..0598a4a1 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -52,17 +52,6 @@ function getYoutubeFeed(playlistid, results, htmlid) { "
" ); } - if (isIndex && htmlid === "#sessions-videos") { - $(htmlid).append( - '" - ); - } if (isOD && htmlid === "#sessions-videos") { $(htmlid).append( '
' + @@ -151,9 +140,6 @@ countdown(); //Youtube slideshow for index page function onGoogleLoad() { - if (isIndex) { - getYoutubeFeed(youtubeSessionsPlaylistID, 7, "#sessions-videos"); - } if (isOD) { getYoutubeFeed(youtubeSessionsPlaylistID, 15, "#sessions-videos"); } diff --git a/views/index.tmpl b/views/index.tmpl index e56d2498..5b87b60f 100644 --- a/views/index.tmpl +++ b/views/index.tmpl @@ -116,11 +116,6 @@
{{end}} -
-

Live Music on URY

-
-
-
{{end}} {{end}} From 10ac97e8e6837f1807274fc19c560c7a4271b7a2 Mon Sep 17 00:00:00 2001 From: Alyx BB Date: Sun, 5 Nov 2023 01:08:25 +0000 Subject: [PATCH 3/4] Revert "cleaned up index infobar" This reverts commit fadbed1bcafcebfd68da62254a0eca79bc06eb41. --- controllers/index.go | 7 +++++-- models/index.go | 8 +++++++- views/index.tmpl | 21 ++++++++++++++++----- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/controllers/index.go b/controllers/index.go index 932adb26..f51e9cff 100644 --- a/controllers/index.go +++ b/controllers/index.go @@ -19,6 +19,7 @@ type IndexController struct { type RenderData struct { CurrentAndNext *myradio.CurrentAndNext Banners []myradio.Banner + Teams []myradio.Team Timeslots []myradio.Timeslot Podcasts []myradio.Podcast MsgBoxError bool @@ -36,7 +37,7 @@ func (ic *IndexController) Get(w http.ResponseWriter, r *http.Request) { // This is where any form params would be parsed model := models.NewIndexModel(ic.session) - currentAndNext, banners, timeslots, podcasts, showOnAir, err := model.Get() + currentAndNext, banners, teams, timeslots, podcasts, showOnAir, err := model.Get() if err != nil { log.Println(err) @@ -46,6 +47,7 @@ func (ic *IndexController) Get(w http.ResponseWriter, r *http.Request) { data := RenderData{ CurrentAndNext: currentAndNext, Banners: banners, + Teams: teams, Timeslots: timeslots, Podcasts: podcasts, ShowOnAir: showOnAir, @@ -64,7 +66,7 @@ func (ic *IndexController) Post(w http.ResponseWriter, r *http.Request) { // Get all the data for the webpage model := models.NewIndexModel(ic.session) - currentAndNext, banners, timeslots, podcasts, showOnAir, err := model.Get() + currentAndNext, banners, teams, timeslots, podcasts, showOnAir, err := model.Get() if err != nil { log.Println(err) @@ -74,6 +76,7 @@ func (ic *IndexController) Post(w http.ResponseWriter, r *http.Request) { data := RenderData{ CurrentAndNext: currentAndNext, Banners: banners, + Teams: teams, Timeslots: timeslots, Podcasts: podcasts, ShowOnAir: showOnAir, diff --git a/models/index.go b/models/index.go index f826e209..56cf5744 100644 --- a/models/index.go +++ b/models/index.go @@ -19,7 +19,7 @@ func NewIndexModel(s *myradio.Session) *IndexModel { // // On success, it returns the current and next show, and nil. // Otherwise, it returns undefined data and the error causing failure. -func (m *IndexModel) Get() (currentAndNext *myradio.CurrentAndNext, banners []myradio.Banner, timeslots []myradio.Timeslot, podcasts []myradio.Podcast, showOnAir bool, err error) { +func (m *IndexModel) Get() (currentAndNext *myradio.CurrentAndNext, banners []myradio.Banner, teams []myradio.Team, timeslots []myradio.Timeslot, podcasts []myradio.Podcast, showOnAir bool, err error) { currentAndNext, err = m.session.GetCurrentAndNext() if err != nil { return @@ -28,6 +28,12 @@ func (m *IndexModel) Get() (currentAndNext *myradio.CurrentAndNext, banners []my if err != nil { return } + + teams, err = m.session.GetCurrentTeams() + if err != nil { + return + } + timeslots, err = m.session.GetPreviousTimeslots(11) if err != nil { return diff --git a/views/index.tmpl b/views/index.tmpl index 5b87b60f..76bd253d 100644 --- a/views/index.tmpl +++ b/views/index.tmpl @@ -28,15 +28,26 @@
-
+
{{template "message_box" .}}
-
+

Get Involved


-

University Radio York has been alive since 1968, when we became the first legal independent radio station in the UK!

-

Help us continue our legacy by joining the URY team.

-

find out more

+
+
+

University Radio York has been alive since 1968, when we became the first legal independent radio station in the UK!

+

Help us continue our legacy by joining the URY team.

+

Contact our teams to find out more.

+
+
+ +
+
From a319987699606a83f154f55382b1db54550c3303 Mon Sep 17 00:00:00 2001 From: Alyx BB Date: Sun, 5 Nov 2023 01:26:17 +0000 Subject: [PATCH 4/4] yeet sessions but harder --- config.toml.example | 1 - public/js/index.js | 16 ---------------- sass/base/_backgrounds.scss | 5 ----- sass/base/_uryCard.scss | 4 ---- structs/config.go | 1 - views/index.tmpl | 1 - views/on_demand.tmpl | 23 ----------------------- 7 files changed, 51 deletions(-) diff --git a/config.toml.example b/config.toml.example index 2fd36bb1..dc839cbe 100644 --- a/config.toml.example +++ b/config.toml.example @@ -64,7 +64,6 @@ [pageContext.youtube] APIKey = "AIzaSyCzI5Gvpq1hPlfjvB81EVc0vLv_11eW7NI" - sessionsPlaylistID = "PLsxUDJzU4VKDudlmlYb-ImFKreFKAfFln" cinPlaylistID = "PLsxUDJzU4VKAAH1pOogbzJx7pZgd-2zOx" channelURL = "//youtube.com/ury1350" diff --git a/public/js/index.js b/public/js/index.js index 0598a4a1..eaeb41bc 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -52,19 +52,6 @@ function getYoutubeFeed(playlistid, results, htmlid) { "
" ); } - if (isOD && htmlid === "#sessions-videos") { - $(htmlid).append( - '" - ); - } if (isIndex && htmlid === "#cin-videos") { $(htmlid).append( '
' + @@ -140,9 +127,6 @@ countdown(); //Youtube slideshow for index page function onGoogleLoad() { - if (isOD) { - getYoutubeFeed(youtubeSessionsPlaylistID, 15, "#sessions-videos"); - } if (isIndex) { getYoutubeFeed(youtubeCINPlaylistID, 7, "#cin-videos"); } diff --git a/sass/base/_backgrounds.scss b/sass/base/_backgrounds.scss index 8737aff4..7a004e57 100644 --- a/sass/base/_backgrounds.scss +++ b/sass/base/_backgrounds.scss @@ -49,11 +49,6 @@ background: none !important; } -.bg-sessions { - background: desaturate($music-purple, 20%); - color: $white; -} - .bg-podcasts { background: $computing-grey; color: $white; diff --git a/sass/base/_uryCard.scss b/sass/base/_uryCard.scss index c92cbf0d..d6ace43b 100644 --- a/sass/base/_uryCard.scss +++ b/sass/base/_uryCard.scss @@ -54,10 +54,6 @@ a.ury-card, } } - &.sessions { - background: $music-purple; - } - &.cin { color: $cin-background; background: $cin-primary; diff --git a/structs/config.go b/structs/config.go index 6afdb296..8d7a672f 100644 --- a/structs/config.go +++ b/structs/config.go @@ -93,7 +93,6 @@ type Page struct { type youtube struct { APIKey string `toml:"apiKey"` - SessionsPlaylistID string `toml:"sessionsPlaylistID"` CINPlaylistID string `toml:"cinPlaylistID"` ChannelURL string `toml:"channelURL"` } diff --git a/views/index.tmpl b/views/index.tmpl index 76bd253d..ecf4b2a9 100644 --- a/views/index.tmpl +++ b/views/index.tmpl @@ -134,7 +134,6 @@ - - -{{end}}