|
@@ -94,7 +94,7 @@ func Handlers() *mux.Router {
|
|
|
|
|
|
// Dashboard
|
|
|
|
|
|
- r.Handle("/", jwtCookie.Handler(recoverHandler(dashboardHandler())))
|
|
|
+ r.Handle("/", jwtCookie.Handler(recoverHandler(homeHandler())))
|
|
|
|
|
|
// Generate model handlers
|
|
|
|
|
@@ -113,7 +113,7 @@ func Handlers() *mux.Router {
|
|
|
}
|
|
|
|
|
|
func onError(w http.ResponseWriter, r *http.Request, err string) {
|
|
|
- http.Redirect(w, r, "/login", http.StatusTemporaryRedirect)
|
|
|
+ http.Redirect(w, r, "/login?tpl_layout=login&tpl_content=login", http.StatusTemporaryRedirect)
|
|
|
}
|
|
|
|
|
|
func respondWithStaticFile(w http.ResponseWriter, filename string) error {
|
|
@@ -232,3 +232,10 @@ func modelHandler(base, path, redirectPath string) http.Handler {
|
|
|
|
|
|
return http.HandlerFunc(fn)
|
|
|
}
|
|
|
+
|
|
|
+func homeHandler() http.Handler {
|
|
|
+ fn := func(w http.ResponseWriter, r *http.Request) {
|
|
|
+ http.Redirect(w, r, "/teachers?format=html&tpl_layout=teachers&tpl_content=teachers", http.StatusSeeOther)
|
|
|
+ }
|
|
|
+ return http.HandlerFunc(fn)
|
|
|
+}
|