From d3071ca110bd29d783296c81cffabe4bc63ef504 Mon Sep 17 00:00:00 2001 From: emile Date: Wed, 9 Sep 2015 10:29:49 +0200 Subject: [PATCH] web provider renderer --- configuration.html => templates/configuration.tmpl | 0 web.go | 9 +-------- 2 files changed, 1 insertion(+), 8 deletions(-) rename configuration.html => templates/configuration.tmpl (100%) diff --git a/configuration.html b/templates/configuration.tmpl similarity index 100% rename from configuration.html rename to templates/configuration.tmpl diff --git a/web.go b/web.go index 8be9dd2b2..3170f0d74 100644 --- a/web.go +++ b/web.go @@ -7,7 +7,6 @@ import ( "github.com/gorilla/handlers" "github.com/unrolled/render" "fmt" - "html/template" "io/ioutil" "encoding/json" "log" @@ -50,11 +49,5 @@ func GetConfigHandler(rw http.ResponseWriter, r *http.Request) { } func GetHtmlConfigHandler(response http.ResponseWriter, request *http.Request) { - templates := template.Must(template.ParseFiles("configuration.html")) - response.Header().Set("Content-type", "text/html") - err := request.ParseForm() - if err != nil { - http.Error(response, fmt.Sprintf("error parsing url %v", err), 500) - } - templates.ExecuteTemplate(response, "configuration.html", Page{Configuration:*currentConfiguration}) + renderer.HTML(response, http.StatusOK, "configuration", Page{Configuration:*currentConfiguration}) }