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

	short := html.EscapeString(r.URL.Query().Get("short"))
	templateData := struct {
		generalTemplateData
		Short string
	}{Short: short}

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

	err = template.Execute(w, templateData)
	if err != nil {
		log.Printf("error: %v\n", err)
	}
}
// NewSubject serves the form to create a new subject.
NewSubject serves the form to create a new subject.
// NewSubject serves the form to create a new subject .
func NewSubject(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
	redirected, _ := ensureLoggedIn(w, r)
	if redirected {
		return
	}
	short := html.EscapeString(r.URL.Query().Get("short"))
	templateData := struct {
		generalTemplateData
		Short string
	}{Short: short}
	template, err := template.ParseFiles("templates/base.html", "templates/subject/new.html")
	if err != nil {
		log.Printf("error: %v\n", err)
	}
	err = template.Execute(w, templateData)
	if err != nil {
		log.Printf("error: %v\n", err)
	}
}
func NewSubject ( w http . ResponseWriter , r * http . Request , _ httprouter . Params ) { redirected , _ := ensureLoggedIn ( w , r ) if redirected { return } short := html . EscapeString ( r . URL . Query ( ) . Get ( " " ) ) templateData := struct { generalTemplateData Short string } { Short : short } template , err := template . ParseFiles ( " " , " " ) if err != nil { log . Printf ( " \n " , err ) } err = template . Execute ( w , templateData ) if err != nil { log . Printf ( " \n " , err ) } }
NewSubject serves the form to create a new subject.
NewSubject serves the form to create a new subject .