diff --git a/gserver/templates/header.html b/gserver/templates/header.html index 9574a4a..763271c 100644 --- a/gserver/templates/header.html +++ b/gserver/templates/header.html @@ -9,7 +9,7 @@ {{ if .data }} - {{ if .data.EP }} + {{ if eq .page "ep" }} @@ -19,7 +19,7 @@ {{ end }} - {{ if .data.LT }} + {{ if eq .page "lt" }} diff --git a/gserver/webapp.go b/gserver/webapp.go index 9e3e35b..f8ad38e 100644 --- a/gserver/webapp.go +++ b/gserver/webapp.go @@ -25,6 +25,7 @@ func GetIndex(c *gin.Context) { c.HTML(http.StatusOK, "index.html", gin.H{ "title": "Neue Episoden", "data": data, + "page": "index", }) } @@ -40,6 +41,7 @@ func GetLps(c *gin.Context) { c.HTML(http.StatusOK, "lps.html", gin.H{ "title": "Let's Plays", "data": data, + "page": "lps", }) } @@ -56,6 +58,7 @@ func GetLt(c *gin.Context) { c.HTML(http.StatusOK, "lt.html", gin.H{ "title": LT.Name.String, "data": gin.H{"LT": LT, "AT": AT, "DESC": template.HTML(LT.Descr.String)}, + "page": "lt", }) } else { //LT not found @@ -73,6 +76,7 @@ func GetLt(c *gin.Context) { c.HTML(http.StatusOK, "lts.html", gin.H{ "title": "Let's Tests", "data": data, + "page": "lts", }) } } @@ -98,6 +102,7 @@ func GetAt(c *gin.Context) { c.HTML(http.StatusOK, "at.html", gin.H{ "title": AT.Name.String, "data": data, + "page": "at", }) } else { //LT not found @@ -113,6 +118,7 @@ func GetAt(c *gin.Context) { c.HTML(http.StatusOK, "ats.html", gin.H{ "title": "Sprecher", "data": data, + "page": "ats", }) } @@ -139,6 +145,7 @@ func GetLEpisode(c *gin.Context) { c.HTML(http.StatusOK, "episode.html", gin.H{ "title": EP.Name.String + " – " + LP.Name.String, "data": gin.H{"EP": EP, "LP": LP, "AT": AT, "DESC": template.HTML(EP.Descr.String), "NEXT": next, "PREV": previous}, + "page": "ep", }) } else { //EP not found @@ -159,6 +166,7 @@ func GetLEpisode(c *gin.Context) { "title": LP.Name.String, "data": data, "message": Message{Type: "alert", String: "Fehler 404: Episode nicht gefunden!"}, + "page": "lp", }) } } else { @@ -179,6 +187,7 @@ func GetLEpisode(c *gin.Context) { c.HTML(http.StatusOK, "lp.html", gin.H{ "title": LP.Name.String, "data": data, + "page": "lp", }) } } else {