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

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

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

	templateData := struct {
		generalTemplateData
		model.Subject
	}{Subject: subject}

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