From cc27f9ef1dcc42874a6d4081aafd8463db1b727e Mon Sep 17 00:00:00 2001 From: Maxime Date: Wed, 24 Apr 2024 12:18:05 +0200 Subject: [PATCH] add path to silvemobi.html in parcourmob/config.yaml + add path and state in renderer/silvermobi.go --- handlers/application/silvermobi.go | 3 ++- main.go | 8 ++++---- renderer/silvermobi.go | 15 ++++++++++++++- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/handlers/application/silvermobi.go b/handlers/application/silvermobi.go index 27309d5..21e986e 100644 --- a/handlers/application/silvermobi.go +++ b/handlers/application/silvermobi.go @@ -6,7 +6,8 @@ import ( ) -func (h *ApplicationHandler) SilvermobiBookingList(w http.ResponseWriter, r *http.Request) { +func (h *ApplicationHandler) SilvermobiBookingList(w http.ResponseWriter, r *http.Request ) { + h.Renderer.SilvermobiBookingList(w, r) fmt.Println("SilverBookingR") } diff --git a/main.go b/main.go index b43de57..56c028f 100755 --- a/main.go +++ b/main.go @@ -137,11 +137,11 @@ func main() { application.HandleFunc("/support/", applicationHandler.SupportSend) /*********************** CODE GROUP **************************/ - // silvermobi - application.HandleFunc("/app/silvermobi/", applicationHandler.SilvermobiBookingCreate) + //=================================silvermobi==================================== + application.HandleFunc("/app/silvermobi/create", applicationHandler.SilvermobiBookingCreate) application.HandleFunc("/app/silvermobi/", applicationHandler.SilvermobiBookingList) - application.HandleFunc("/app/silvermobi/", applicationHandler.SilvermobiBookingUpdate) - application.HandleFunc("/app/silvermobi/", applicationHandler.SilvermobiBookingDelete) + application.HandleFunc("/app/silvermobi/update/{memberid}/{bookingid}", applicationHandler.SilvermobiBookingUpdate) + application.HandleFunc("/app/silvermobi/delete/{memberid}/{bookingid}", applicationHandler.SilvermobiBookingDelete) appGroup := application.PathPrefix("/group_module").Subrouter() appGroup.HandleFunc("/", applicationHandler.Groups) diff --git a/renderer/silvermobi.go b/renderer/silvermobi.go index 7b6a2da..df5eb48 100644 --- a/renderer/silvermobi.go +++ b/renderer/silvermobi.go @@ -1,3 +1,16 @@ package renderer -const silvermobiMenu = "silvermobi" \ No newline at end of file +import ( + "net/http" + +) + +const silvermobiMenu = "silvermobi" + +func (renderer *Renderer) SilvermobiBookingList( w http.ResponseWriter, r *http.Request) { + files:= renderer.ThemeConfig.GetStringSlice("views.silvermobi.list.files") + state := NewState(r, renderer.ThemeConfig, silvermobiMenu) + + renderer.Render("silvermobi settings", w, r, files, state) + +}