Setting up stub pages

This commit is contained in:
vinchent 2024-08-21 21:49:08 +02:00
parent ffa6b9a423
commit afcd5ba075
5 changed files with 42 additions and 4 deletions

View File

@ -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)
}
}

View File

@ -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)

View File

@ -0,0 +1,14 @@
{{template "base" .}}
{{define "title"}}
All Subscriptions
{{end}}
{{define "content"}}
<h2 class="mt-5">All Sales</h2>
<hr>
{{end}}
{{define "js"}}
{{end}}

View File

@ -0,0 +1,13 @@
{{template "base" .}}
{{define "title"}}
All Subscriptions
{{end}}
{{define "content"}}
<h2 class="mt-5">All Subscriptions</h2>
<hr>
{{end}}
{{define "js"}}
{{end}}

View File

@ -47,9 +47,6 @@
</li>
</ul>
</li>
<li id="vt-link" class="nav-item d-none">
<a class="nav-link" href="/admin/virtual-terminal">Virtual Terminal</a>
</li>
{{ if eq .IsAuthenticated 1 }}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle"
@ -68,7 +65,7 @@
<a class="dropdown-item" href="/admin/all-sales">All Sales</a>
</li>
<li>
<a class="dropdown-item" href="/admin/all-subscriptions">All Sales</a>
<a class="dropdown-item" href="/admin/all-subscriptions">All Subscriptions</a>
</li>
<li>
<hr class="dropdown-divider">