diff --git a/controllers/route.go b/controllers/route.go index 9ce43590..ef67697c 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -182,7 +182,6 @@ func Register(w http.ResponseWriter, r *http.Request) { // Base handles the default path and template execution func Base(w http.ResponseWriter, r *http.Request) { - // Example of using session - will be removed. params := struct { User models.User Title string @@ -255,6 +254,14 @@ func LandingPages(w http.ResponseWriter, r *http.Request) { // Settings handles the changing of settings func Settings(w http.ResponseWriter, r *http.Request) { switch { + case r.Method == "GET": + params := struct { + User models.User + Title string + Flashes []interface{} + Token string + }{Title: "Dashboard", User: ctx.Get(r, "user").(models.User), Token: nosurf.Token(r)} + getTemplate(w, "settings").ExecuteTemplate(w, "base", params) case r.Method == "POST": err := auth.ChangePassword(r) msg := models.Response{Success: true, Message: "Settings Updated Successfully"} diff --git a/templates/dashboard.html b/templates/dashboard.html index 52758493..c2fea5b3 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -78,3 +78,6 @@ {{end}} +{{define "scripts"}} + +{{end}} diff --git a/templates/register.html b/templates/register.html index 940116db..1dfe10d4 100644 --- a/templates/register.html +++ b/templates/register.html @@ -8,7 +8,7 @@ - +