create stub handlers for admin functionnality

This commit is contained in:
vinchent 2024-07-22 14:05:20 +02:00
parent ea796999d4
commit b34c217d98
6 changed files with 52 additions and 1 deletions

View File

@ -40,6 +40,10 @@ func routes(app *config.AppConfig) http.Handler {
mux.Route("/admin", func(mux chi.Router) {
mux.Use(Auth)
mux.Get("/dashboard", handlers.Repo.AdminDashboard)
mux.Get("/reservations-new", handlers.Repo.AdminNewReservations)
mux.Get("/reservations-all", handlers.Repo.AdminAllReservations)
mux.Get("/reservations-calendar", handlers.Repo.AdminReservationsCalendar)
})
return mux

View File

@ -506,3 +506,15 @@ func (m *Repository) Logout(w http.ResponseWriter, r *http.Request) {
func (m *Repository) AdminDashboard(w http.ResponseWriter, r *http.Request) {
render.Template(w, r, "admin-dashboard.page.tmpl", &models.TemplateData{})
}
func (m *Repository) AdminNewReservations(w http.ResponseWriter, r *http.Request) {
render.Template(w, r, "admin-new-reservations.page.tmpl", &models.TemplateData{})
}
func (m *Repository) AdminAllReservations(w http.ResponseWriter, r *http.Request) {
render.Template(w, r, "admin-all-reservations.page.tmpl", &models.TemplateData{})
}
func (m *Repository) AdminReservationsCalendar(w http.ResponseWriter, r *http.Request) {
render.Template(w, r, "admin-reservations-calendar.page.tmpl", &models.TemplateData{})
}

View File

@ -0,0 +1,12 @@
{{template "admin" .}}
{{define "page-title"}}
All Reservations
{{end}}
{{define "content"}}
<div class="col-md-12">
All Reservations content
</div>
{{end}}

View File

@ -0,0 +1,12 @@
{{template "admin" .}}
{{define "page-title"}}
New Reservations
{{end}}
{{define "content"}}
<div class="col-md-12">
New Reservations content
</div>
{{end}}

View File

@ -0,0 +1,11 @@
{{template "admin" .}}
{{define "page-title"}}
Reservations Calendar
{{end}}
{{define "content"}}
<div class="col-md-12">
Reservations calendar content
</div>
{{end}}

View File

@ -72,7 +72,7 @@
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="/admin/reservation-calendar">
<a class="nav-link" href="/admin/reservations-calendar">
<i class="ti-layout-list-post menu-icon"></i>
<span class="menu-title">Reservation Canlendar</span>
</a>