Solidarity transport
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/icons"
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||
@@ -37,7 +38,6 @@ func NewRenderer(global *viper.Viper, templates_dir string) *Renderer {
|
||||
}
|
||||
|
||||
func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Request, files []string, state RenderState) {
|
||||
|
||||
genericFiles := renderer.ThemeConfig.GetStringSlice("views.generic.files")
|
||||
|
||||
prefixed_files := []string{}
|
||||
@@ -61,6 +61,7 @@ func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Req
|
||||
"walkingLength": WalkingLength,
|
||||
"divideFloat64": Divide[float64],
|
||||
"divideInt": Divide[int],
|
||||
"typeOf": reflect.TypeOf,
|
||||
},
|
||||
)
|
||||
t = template.Must(t.ParseFiles(prefixed_files...))
|
||||
@@ -72,7 +73,6 @@ func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Req
|
||||
}
|
||||
|
||||
func (renderer *Renderer) RenderNoLayout(name string, w http.ResponseWriter, r *http.Request, files []string, state RenderState) {
|
||||
|
||||
prefixed_files := []string{}
|
||||
for _, f := range files {
|
||||
prefixed_files = append(prefixed_files, renderer.templateFile(f))
|
||||
@@ -90,6 +90,7 @@ func (renderer *Renderer) RenderNoLayout(name string, w http.ResponseWriter, r *
|
||||
"unsescapeHTML": UnescapeHTML,
|
||||
"divideFloat64": Divide[float64],
|
||||
"divideInt": Divide[int],
|
||||
"typeOf": reflect.TypeOf,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -189,6 +190,15 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
||||
})
|
||||
}
|
||||
|
||||
if modules["solidarity_transport"] != nil && modules["solidarity_transport"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Transport solidaire",
|
||||
Link: "/app/solidarity-transport/",
|
||||
Active: menuState == solidarityTransportMenu,
|
||||
Icon: "tabler-icons:car",
|
||||
})
|
||||
}
|
||||
|
||||
if modules["vehicles"] != nil && modules["vehicles"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Véhicules partagés",
|
||||
@@ -223,7 +233,6 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
||||
Active: menuState == groupMenu,
|
||||
Icon: "hero:outline/group_module",
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if modules["support"] != nil && modules["support"].(bool) {
|
||||
@@ -233,7 +242,6 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
||||
Active: menuState == commentMenu,
|
||||
Icon: "hero:outline/support",
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if modules["directory"] != nil && modules["directory"].(bool) {
|
||||
@@ -244,22 +252,23 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
||||
Icon: "hero:outline/document-text",
|
||||
})
|
||||
}
|
||||
if modules["conseillers"] != nil && modules["conseillers"].(bool) {
|
||||
/*if modules["conseillers"] != nil && modules["conseillers"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Conseillers",
|
||||
Link: "/app/conseillers/",
|
||||
Active: menuState == membersMenu,
|
||||
Icon: "hero:outline/user-group",
|
||||
})
|
||||
}
|
||||
if modules["diags"] != nil && modules["diags"].(bool) {
|
||||
}*/
|
||||
/*if modules["diags"] != nil && modules["diags"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Diagnostics",
|
||||
Link: "/app/diags/",
|
||||
Active: menuState == diagsMenu,
|
||||
Icon: "hero:outline/document-text",
|
||||
})
|
||||
}
|
||||
}*/
|
||||
|
||||
return RenderState{
|
||||
IconSet: icons.NewIconSet(iconset),
|
||||
Group: group,
|
||||
|
||||
Reference in New Issue
Block a user