Emailing management, administration improvement, Carpooling in multimodal search
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/icons"
|
||||
"git.coopgo.io/coopgo-apps/parcoursmob/utils/identification"
|
||||
"git.coopgo.io/coopgo-platform/emailing"
|
||||
"git.coopgo.io/coopgo-platform/groups-management/storage"
|
||||
"github.com/spf13/viper"
|
||||
)
|
||||
@@ -15,6 +16,7 @@ type Renderer struct {
|
||||
TemplatesDir string
|
||||
GlobalConfig *viper.Viper
|
||||
ThemeConfig *viper.Viper
|
||||
Mailer *emailing.Mailer
|
||||
}
|
||||
|
||||
func NewRenderer(global *viper.Viper, templates_dir string) *Renderer {
|
||||
@@ -50,6 +52,9 @@ func (renderer *Renderer) Render(name string, w http.ResponseWriter, r *http.Req
|
||||
"genderISO5218": GenderISO5218,
|
||||
"dict": Dict,
|
||||
"json": JSON,
|
||||
"walkingLength": WalkingLength,
|
||||
"divideFloat64": Divide[float64],
|
||||
"divideInt": Divide[int],
|
||||
},
|
||||
)
|
||||
t = template.Must(t.ParseFiles(prefixed_files...))
|
||||
@@ -72,6 +77,8 @@ func (renderer *Renderer) RenderNoLayout(name string, w http.ResponseWriter, r *
|
||||
"genderISO5218": GenderISO5218,
|
||||
"dict": Dict,
|
||||
"json": JSON,
|
||||
"divideFloat64": Divide[float64],
|
||||
"divideInt": Divide[int],
|
||||
},
|
||||
)
|
||||
|
||||
@@ -119,7 +126,7 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
||||
|
||||
ls := LayoutState{
|
||||
AdministrationState: AdministrationState{
|
||||
Display: modules["administration"].(bool),
|
||||
Display: modules["administration"] != nil && modules["administration"].(bool),
|
||||
Active: menuState == administrationMenu,
|
||||
},
|
||||
|
||||
@@ -128,57 +135,66 @@ func NewState(r *http.Request, themeConfig *viper.Viper, menuState string) Rende
|
||||
{
|
||||
Title: "Tableau de bord",
|
||||
Link: "/app/",
|
||||
Active: menuState == "dashboard",
|
||||
Active: menuState == dashboardMenu,
|
||||
Icon: "hero:outline/home",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if modules["beneficiaries"].(bool) {
|
||||
if modules["beneficiaries"] != nil && modules["beneficiaries"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Bénéficiaires",
|
||||
Link: "/app/beneficiaries/",
|
||||
Active: menuState == "beneficiaries",
|
||||
Active: menuState == beneficiariesMenu,
|
||||
Icon: "hero:outline/user-group",
|
||||
})
|
||||
}
|
||||
|
||||
if modules["journeys"].(bool) {
|
||||
if modules["journeys"] != nil && modules["journeys"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Déplacements",
|
||||
Link: "/app/journeys/",
|
||||
Active: menuState == "journeys",
|
||||
Active: menuState == journeysMenu,
|
||||
Icon: "hero:outline/map",
|
||||
})
|
||||
}
|
||||
|
||||
if modules["vehicles"].(bool) {
|
||||
if modules["vehicles"] != nil && modules["vehicles"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Véhicules partagés",
|
||||
Link: "/app/vehicles/",
|
||||
Active: menuState == "vehicles",
|
||||
Active: menuState == vehiclesMenu,
|
||||
Icon: "tabler-icons:car",
|
||||
})
|
||||
}
|
||||
|
||||
if modules["vehicles_management"].(bool) {
|
||||
if modules["vehicles_management"] != nil && modules["vehicles_management"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Gestion des véhicules",
|
||||
Link: "/app/vehicles-management/",
|
||||
Active: menuState == "vehicles_management",
|
||||
Active: menuState == vehiclesmanagementMenu,
|
||||
Icon: "hero:outline/briefcase",
|
||||
})
|
||||
}
|
||||
|
||||
if modules["agenda"].(bool) {
|
||||
if modules["agenda"] != nil && modules["agenda"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Agenda dispositifs",
|
||||
Link: "/app/agenda/",
|
||||
Active: menuState == "agenda",
|
||||
Active: menuState == agendaMenu,
|
||||
Icon: "hero:outline/calendar",
|
||||
})
|
||||
}
|
||||
|
||||
if modules["directory"] != nil && modules["directory"].(bool) {
|
||||
ls.MenuItems = append(ls.MenuItems, MenuItem{
|
||||
Title: "Répertoire solutions",
|
||||
Link: "/app/directory/",
|
||||
Active: menuState == directoryMenu,
|
||||
Icon: "hero:outline/document-text",
|
||||
})
|
||||
}
|
||||
|
||||
return RenderState{
|
||||
IconSet: icons.NewIconSet(iconset),
|
||||
Group: group,
|
||||
|
||||
Reference in New Issue
Block a user