Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

cleaned up index infobar #29

Merged
merged 4 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions controllers/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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,
Expand All @@ -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)
Expand All @@ -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,
Expand Down
8 changes: 1 addition & 7 deletions models/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 8 additions & 16 deletions views/index.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,18 @@
<div id="index-infobar" class="container-fluid bg-off-white container-padded">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-3">
<div class="col-lg-5">
{{template "message_box" .}}
</div>
<div class="col-lg-9">
<div class="col-lg-1">

</div>
<div class="col-lg-5">
<h2>Get Involved</h2>
<hr>
<div class="row">
<div class="col-lg-6">
<p>University Radio York has been alive since 1968, when we became the first legal independent radio station in the UK!</p>
<p>Help us continue our legacy by joining the URY team.</p>
<p>Contact our teams to find out more.</p>
</div>
<div class="col-lg-6">
<ul class="split-evenly-2 no-bullets">
{{range .Teams}}
<li><a href="{{url "/teams/"}}{{.Alias}}/" title="Find out more about {{.Name}}">{{.Name}}</a></li>
{{end}}
</ul>
</div>
</div>
<p>University Radio York has been alive since 1968, when we became the first legal independent radio station in the UK!</p>
<p>Help us continue our legacy by joining the URY team.</p>
<p><a href="{{url "/getinvolved/"}}">find out more</a></p>
</div>
</div>
</div>
Expand Down
Loading