2022-08-11 15:26:55 +00:00
|
|
|
package renderer
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
const vehiclesmanagementMenu = "vehicles_management"
|
|
|
|
|
2022-08-12 12:53:54 +00:00
|
|
|
func (renderer *Renderer) VehiclesManagementOverview(w http.ResponseWriter, r *http.Request, vehicles []any) {
|
2022-08-11 15:26:55 +00:00
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.overview.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
2022-08-12 12:53:54 +00:00
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"vehicles": vehicles,
|
|
|
|
}
|
2022-08-11 15:26:55 +00:00
|
|
|
|
2022-08-12 12:53:54 +00:00
|
|
|
renderer.Render("fleet overview", w, r, files, state)
|
2022-08-11 15:26:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) VehiclesFleetAdd(w http.ResponseWriter, r *http.Request) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.fleet_add.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
|
|
|
|
2022-08-12 12:53:54 +00:00
|
|
|
renderer.Render("fleet add vehicle", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) VehiclesFleetDisplay(w http.ResponseWriter, r *http.Request, vehicle any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.fleet_display.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"vehicle": vehicle,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("fleet display vehicle", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) VehiclesFleetUpdate(w http.ResponseWriter, r *http.Request, vehicle any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.fleet_update.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"vehicle": vehicle,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("fleet display vehicle", w, r, files, state)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (renderer *Renderer) VehicleManagementBookingDisplay(w http.ResponseWriter, r *http.Request, booking any, vehicle any, beneficiary any, group any) {
|
|
|
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.booking_display.files")
|
|
|
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
|
|
|
state.ViewState = map[string]any{
|
|
|
|
"booking": booking,
|
|
|
|
"vehicle": vehicle,
|
|
|
|
"beneficiary": beneficiary,
|
|
|
|
"group": group,
|
|
|
|
}
|
|
|
|
|
|
|
|
renderer.Render("vehicles search", w, r, files, state)
|
2022-08-11 15:26:55 +00:00
|
|
|
}
|