add createDriver renderer et handler

This commit is contained in:
Maxime 2024-12-04 17:46:25 +01:00
parent f43d02c762
commit a8ef3b758f
3 changed files with 16 additions and 0 deletions

View File

@ -144,4 +144,11 @@ func (h *ApplicationHandler) SolidarityService (w http.ResponseWriter, r *http.R
h.cache.PutWithTTL(cacheid, accounts, 1*time.Hour)
h.Renderer.BeneficiariesSolidarity(w, r, accounts, drivers, parcourmobAccounts, cacheid)
}
func (h *ApplicationHandler) CreateDriver (w http.ResponseWriter, r *http.Request) {
h.Renderer.CreateDriver(w, r)
}

View File

@ -140,6 +140,8 @@ func main() {
//=================================silvermobi====================================
application.HandleFunc("/solidarity_service/", applicationHandler.SolidarityService)
application.HandleFunc("/solidarity_service/create/{id}", applicationHandler.DriversJourney)
application.HandleFunc("/solidarity_service/driver/create", applicationHandler.CreateDriver)
appGroup := application.PathPrefix("/group_module").Subrouter()
appGroup.HandleFunc("/", applicationHandler.Groups)

View File

@ -114,3 +114,10 @@ func (renderer *Renderer) SolidarityServiceListAvailableDrivers(w http.ResponseW
renderer.Render("solidarity_service", w, r, files, state)
}
func (renderer *Renderer) CreateDriver(w http.ResponseWriter, r *http.Request) {
files := renderer.ThemeConfig.GetStringSlice("views.solidarity_service.create_driver.files")
state := NewState(r, renderer.ThemeConfig, solidarityserviceMenu)
renderer.Render("solidarity_service", w, r, files, state)
}