diff --git a/cmd/web/routes.go b/cmd/web/routes.go index 13f90e5..679bd91 100644 --- a/cmd/web/routes.go +++ b/cmd/web/routes.go @@ -35,6 +35,8 @@ func routes(app *config.AppConfig) http.Handler { mux.Post("/make-reservation", handlers.Repo.PostReservation) mux.Get("/reservation-summary", handlers.Repo.ReservationSummary) + mux.Get("/user-login", handlers.Repo.ShowLogin) + fileServer := http.FileServer(http.Dir("./static/")) mux.Handle("/static/*", http.StripPrefix("/static", fileServer)) diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index eb7b482..c2df469 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -447,3 +447,9 @@ func (m *Repository) BookRoom(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/make-reservation", http.StatusSeeOther) } + +func (m *Repository) ShowLogin(w http.ResponseWriter, r *http.Request) { + render.Template(w, r, "login.page.tmpl", &models.TemplateData{ + Form: forms.New(nil), + }) +} diff --git a/templates/login.page.tmpl b/templates/login.page.tmpl index b4f2923..28b2976 100644 --- a/templates/login.page.tmpl +++ b/templates/login.page.tmpl @@ -6,7 +6,7 @@

Login

- + {{with.Form.Errors.Get "email"}} {{end}} @@ -15,7 +15,7 @@ name='email' value="" required>
- + {{with.Form.Errors.Get "password"}} {{end}}