Esempio n. 1
0
func GetHomePage(rw http.ResponseWriter, req *http.Request) {

	p := common.BasePage{
		Title: "David Ayeke",
		Nav:   []string{"discover"},
	}

	common.Templates = template.Must(template.ParseFiles("templates/home/home.html", common.LayoutPath))
	err := common.Templates.ExecuteTemplate(rw, "base", p)
	common.CheckError(err, common.Error)
}
Esempio n. 2
0
func GetHomePage(rw http.ResponseWriter, req *http.Request) {
	type Page struct {
		Title string
	}

	p := Page{
		Title: "user_home",
	}

	common.Templates = template.Must(template.ParseFiles("templates/user/home.html", common.LayoutPath))
	err := common.Templates.ExecuteTemplate(rw, "base", p)
	common.CheckError(err, common.Error)
}
Esempio n. 3
0
func GetViewPage(rw http.ResponseWriter, req *http.Request) {
	type Page struct {
		Title  string
		UserId string
	}

	params := mux.Vars(req)
	userId := params["id"]
	//get user Id
	p := Page{
		Title:  "user_view",
		UserId: userId,
	}

	common.Templates = template.Must(template.ParseFiles("templates/user/view.html", common.LayoutPath))
	err := common.Templates.ExecuteTemplate(rw, "base", p)
	common.CheckError(err, common.Error)
}