예제 #1
0
func init() {
	var err error
	local, err = time.LoadLocation("America/New_York")
	if err != nil {
		panic(err)
	}
	http.Handle("/", webapp.Router)
	webapp.HandleFunc("/", index)
	webapp.HandleFunc("/class", class)
	webapp.Handle("/roster", userContextHandler(webapp.HandlerFunc(roster)))
	if appengine.IsDevAppServer() {
		webapp.HandleFunc("/error", throwError)
	}

	for url, template := range map[string]string{
		"/about":           "templates/about.html",
		"/pricing":         "templates/pricing.html",
		"/privates-groups": "templates/privates-groups.html",
		"/teachers":        "templates/teachers.html",
		"/workshops":       "templates/workshops.html",
		"/mailinglist":     "templates/mailinglist.html",
	} {
		webapp.HandleFunc(url, staticTemplate(template))
	}
}
예제 #2
0
func init() {
	for url, fn := range map[string]webapp.HandlerFunc{
		"/staff":                      staffPortal,
		"/staff/add-teacher":          addTeacher,
		"/staff/add-announcement":     addAnnouncement,
		"/staff/delete-announcement":  deleteAnnouncement,
		"/staff/add-session":          addSession,
		"/staff/yin-yogassage":        yinYogassage,
		"/staff/delete-yin-yogassage": deleteYinYogassage,
		"/staff/session":              session,
		"/staff/add-class":            addClass,
		"/staff/edit-class":           editClass,
		"/staff/delete-class":         deleteClass,
	} {
		webapp.HandleFunc(url, userContextHandler(staffContextHandler(fn)))
	}
}
예제 #3
0
func init() {
	webapp.HandleFunc("/register/session", registerForSession)
	webapp.HandleFunc("/register/oneday", registerForOneDay)
	webapp.HandleFunc("/register/paper", registerPaperStudent)
}
예제 #4
0
func init() {
	webapp.HandleFunc("/admin", userContextHandler(webapp.HandlerFunc(admin)))
	webapp.HandleFunc("/admin/add-staff", userContextHandler(webapp.HandlerFunc(addStaff)))
}
예제 #5
0
func init() {
	webapp.HandleFunc("/login", doLogin)
	webapp.HandleFunc("/_ah/login_required", doLogin)
	webapp.HandleFunc("/login/new", newAccount)
}