make use of template engine, add footer
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Philipp 2021-10-01 22:49:47 +02:00
parent 4fd2f099b8
commit 48d9621adf
6 changed files with 278 additions and 259 deletions

View file

@ -40,7 +40,7 @@ func (h *Handler) Home() http.HandlerFunc {
Flags []steamServer.Flag
}
tmpl := template.Must(template.ParseFiles("templates/home.html"))
tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/home.html"))
return func(w http.ResponseWriter, r *http.Request) {
ss, err := h.store.Servers()
if err != nil {
@ -77,7 +77,7 @@ func (h *Handler) Europe() http.HandlerFunc {
Flags []steamServer.Flag
}
tmpl := template.Must(template.ParseFiles("templates/region.html"))
tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/region.html"))
return func(w http.ResponseWriter, r *http.Request) {
reg, err := h.store.Region("Europe")
if err != nil {
@ -125,7 +125,7 @@ func (h *Handler) America() http.HandlerFunc {
Flags []steamServer.Flag
}
tmpl := template.Must(template.ParseFiles("templates/region.html"))
tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/region.html"))
return func(w http.ResponseWriter, r *http.Request) {
reg, err := h.store.Region("North America")
if err != nil {
@ -173,7 +173,7 @@ func (h *Handler) Asia() http.HandlerFunc {
Flags []steamServer.Flag
}
tmpl := template.Must(template.ParseFiles("templates/region.html"))
tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/region.html"))
return func(w http.ResponseWriter, r *http.Request) {
reg, err := h.store.Region("Asia")
if err != nil {
@ -221,7 +221,7 @@ func (h *Handler) Australia() http.HandlerFunc {
Flags []steamServer.Flag
}
tmpl := template.Must(template.ParseFiles("templates/region.html"))
tmpl := template.Must(template.ParseFiles("templates/layout.html", "templates/region.html"))
return func(w http.ResponseWriter, r *http.Request) {
reg, err := h.store.Region("Australia")
if err != nil {