func GetTeacher(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
	redirected, _ := ensureLoggedIn(w, r)
	if redirected {
		return
	}

	short := html.EscapeString(params.ByName("short"))
	teacher := model.Teacher{Short: short}
	if !teacher.Exists() {
		http.NotFound(w, r)
		return
	} else {
		teacher.Read()
	}

	// Execute template with teacher as template data.
	template, err := template.ParseFiles("templates/base.html", "templates/teacher/get.html")
	if err != nil {
		log.Printf("error: %v\n", err)
	}

	templateData := struct {
		generalTemplateData
		model.Teacher
	}{Teacher: teacher}

	err = template.Execute(w, &templateData)
	if err != nil {
		log.Printf("error: %v\n", err)
	}
}
// GetTeacher serves one teacher.
GetTeacher serves one teacher.
// GetTeacher serves one teacher .
func GetTeacher(w http.ResponseWriter, r *http.Request, params httprouter.Params) {
	redirected, _ := ensureLoggedIn(w, r)
	if redirected {
		return
	}
	short := html.EscapeString(params.ByName("short"))
	teacher := model.Teacher{Short: short}
	if !teacher.Exists() {
		http.NotFound(w, r)
		return
	} else {
		teacher.Read()
	}
	template, err := template.ParseFiles("templates/base.html", "templates/teacher/get.html")
	if err != nil {
		log.Printf("error: %v\n", err)
	}
	templateData := struct {
		generalTemplateData
		model.Teacher
	}{Teacher: teacher}
	err = template.Execute(w, &templateData)
	if err != nil {
		log.Printf("error: %v\n", err)
	}
}
func GetTeacher ( w http . ResponseWriter , r * http . Request , params httprouter . Params ) { redirected , _ := ensureLoggedIn ( w , r ) if redirected { return } short := html . EscapeString ( params . ByName ( " " ) ) teacher := model . Teacher { Short : short } if ! teacher . Exists ( ) { http . NotFound ( w , r ) return } else { teacher . Read ( ) } template , err := template . ParseFiles ( " " , " " ) if err != nil { log . Printf ( " \n " , err ) } templateData := struct { generalTemplateData model . Teacher } { Teacher : teacher } err = template . Execute ( w , & templateData ) if err != nil { log . Printf ( " \n " , err ) } }
GetTeacher serves one teacher.
GetTeacher serves one teacher .
// Execute template with teacher as template data.