From afcd5ba075c86cf9aae15db0dcab522c351ae83f Mon Sep 17 00:00:00 2001 From: vinchent Date: Wed, 21 Aug 2024 21:49:08 +0200 Subject: [PATCH] Setting up stub pages --- cmd/web/handlers.go | 12 ++++++++++++ cmd/web/routes.go | 2 ++ cmd/web/templates/all-sales.page.gohtml | 14 ++++++++++++++ cmd/web/templates/all-subscriptions.page.gohtml | 13 +++++++++++++ cmd/web/templates/base.layout.gohtml | 5 +---- 5 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 cmd/web/templates/all-sales.page.gohtml create mode 100644 cmd/web/templates/all-subscriptions.page.gohtml diff --git a/cmd/web/handlers.go b/cmd/web/handlers.go index 79c2890..08a37f8 100644 --- a/cmd/web/handlers.go +++ b/cmd/web/handlers.go @@ -367,3 +367,15 @@ func (app *application) ShowResetPassword(w http.ResponseWriter, r *http.Request app.errorLog.Println(err) } } + +func (app *application) AllSales(w http.ResponseWriter, r *http.Request) { + if err := app.renderTemplate(w, r, "all-sales", &templateData{}); err != nil { + app.errorLog.Println(err) + } +} + +func (app *application) AllSubscriptions(w http.ResponseWriter, r *http.Request) { + if err := app.renderTemplate(w, r, "all-subscriptions", &templateData{}); err != nil { + app.errorLog.Println(err) + } +} diff --git a/cmd/web/routes.go b/cmd/web/routes.go index a68d3e2..ad6a7ca 100644 --- a/cmd/web/routes.go +++ b/cmd/web/routes.go @@ -15,6 +15,8 @@ func (app *application) routes() http.Handler { mux.Route("/admin", func(mux chi.Router) { mux.Use(app.Auth) mux.Get("/virtual-terminal", app.VirtualTerminal) + mux.Get("/all-sales", app.AllSales) + mux.Get("/all-subscriptions", app.AllSubscriptions) }) // mux.Post("/virtual-terminal-payment-succeeded", app.VirtualTerminalPaymentSucceeded) diff --git a/cmd/web/templates/all-sales.page.gohtml b/cmd/web/templates/all-sales.page.gohtml new file mode 100644 index 0000000..5f9599a --- /dev/null +++ b/cmd/web/templates/all-sales.page.gohtml @@ -0,0 +1,14 @@ +{{template "base" .}} + +{{define "title"}} +All Subscriptions +{{end}} + +{{define "content"}} +

All Sales

+
+{{end}} + +{{define "js"}} +{{end}} + diff --git a/cmd/web/templates/all-subscriptions.page.gohtml b/cmd/web/templates/all-subscriptions.page.gohtml new file mode 100644 index 0000000..34d2eb0 --- /dev/null +++ b/cmd/web/templates/all-subscriptions.page.gohtml @@ -0,0 +1,13 @@ +{{template "base" .}} + +{{define "title"}} +All Subscriptions +{{end}} + +{{define "content"}} +

All Subscriptions

+
+{{end}} + +{{define "js"}} +{{end}} diff --git a/cmd/web/templates/base.layout.gohtml b/cmd/web/templates/base.layout.gohtml index b43cd52..220a895 100644 --- a/cmd/web/templates/base.layout.gohtml +++ b/cmd/web/templates/base.layout.gohtml @@ -47,9 +47,6 @@ - {{ if eq .IsAuthenticated 1 }}
  • - All Sales + All Subscriptions