From 56152a62c3d849e0c17c7c0e2191b5481df54e9f Mon Sep 17 00:00:00 2001 From: jacquesfize Date: Tue, 11 Jun 2024 15:15:14 +0200 Subject: [PATCH] fix (menu) external_url enabled again --- backend/geonature/core/gn_commons/routes.py | 8 +-- .../sidenav-items.component.html | 67 ++++++++++++++----- frontend/src/app/models/module.model.ts | 1 + 3 files changed, 56 insertions(+), 20 deletions(-) diff --git a/backend/geonature/core/gn_commons/routes.py b/backend/geonature/core/gn_commons/routes.py index c48b73d025..d27b1b7edf 100644 --- a/backend/geonature/core/gn_commons/routes.py +++ b/backend/geonature/core/gn_commons/routes.py @@ -88,10 +88,10 @@ def list_modules(): } if any(module_dict["cruved"].values()): module_allowed = True - if module.active_frontend: - module_dict["module_url"] = module.module_path - else: - module_dict["module_url"] = module.module_external_url + module_dict["module_external_url"] = ( + "" if module.active_frontend else module.module_external_url + ) + module_dict["module_url"] = module.module_path if module.active_frontend else "" module_dict["module_objects"] = {} # get cruved for each object for obj_dict in module_dict["objects"]: diff --git a/frontend/src/app/components/sidenav-items/sidenav-items.component.html b/frontend/src/app/components/sidenav-items/sidenav-items.component.html index ac1a833ee3..5415175d71 100644 --- a/frontend/src/app/components/sidenav-items/sidenav-items.component.html +++ b/frontend/src/app/components/sidenav-items/sidenav-items.component.html @@ -27,24 +27,42 @@ {{ home_page.module_label }} + + + + + {{ module.module_label }} + + - - - - {{ module.module_label }} - - + + + {{ module.module_label }} + + + + + + + + {{ label }} + + diff --git a/frontend/src/app/models/module.model.ts b/frontend/src/app/models/module.model.ts index 1439c518d1..88bdfc1349 100644 --- a/frontend/src/app/models/module.model.ts +++ b/frontend/src/app/models/module.model.ts @@ -5,4 +5,5 @@ export interface Module { module_path: string; module_doc_url?: string; module_url?: string; + module_external_url?: string; }