Skip to content

Commit

Permalink
fix (menu) external_url enabled again
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Jul 18, 2024
1 parent 95d9b15 commit 56152a6
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 20 deletions.
8 changes: 4 additions & 4 deletions backend/geonature/core/gn_commons/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,42 @@
<span class="module-name">{{ home_page.module_label }}</span>
</mat-list-item>
</a>
<ng-container *ngFor="let module of moduleService.getDisplayedModules(); let index = index">
<a
*ngIf="module.active_frontend; else"
[routerLink]="module.module_url"
[attr.data-qa]="'gn-sidenav-link-' + module.module_code"
[target]="module.module_target"
>
<mat-list-item
class="sidenav-item"
(click)="_sidenavService.toggleSideNav()"
>
<i
class="fa {{ module.module_picto }} picto"
aria-hidden="true"
></i>
<span class="module-name">{{ module.module_label }}</span>
</mat-list-item>
</a>

<a
*ngFor="let module of moduleService.getDisplayedModules(); let index = index"
[routerLink]="module.module_url"
[attr.data-qa]="'gn-sidenav-link-' + module.module_code"
[target]="module.module_target"
>
<mat-list-item
class="sidenav-item"
(click)="_sidenavService.toggleSideNav()"
<a
*ngIf="!module.active_frontend"
href="{{ module.module_external_url }}"
[attr.data-qa]="'gn-sidenav-link-' + module.module_code"
>
<i
class="fa {{ module.module_picto }} picto"
aria-hidden="true"
></i>
<span class="module-name">{{ module.module_label }}</span>
</mat-list-item>
</a>
<mat-list-item
class="sidenav-item"
(click)="_sidenavService.toggleSideNav()"
>
<i
class="fa {{ module.module_picto }} picto"
aria-hidden="true"
></i>
<span class="module-name">{{ module.module_label }}</span>
</mat-list-item>
</a>
</ng-container>
</mat-nav-list>

<div class="navbar-footer">
Expand Down Expand Up @@ -74,3 +92,20 @@
</a>
</p>
</div>

<ng-template
#menuLink
let-picto
let-label
>
<mat-list-item
class="sidenav-item"
(click)="_sidenavService.toggleSideNav()"
>
<i
class="fa {{ picto }} picto"
aria-hidden="true"
></i>
<span class="module-name">{{ label }}</span>
</mat-list-item>
</ng-template>
1 change: 1 addition & 0 deletions frontend/src/app/models/module.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export interface Module {
module_path: string;
module_doc_url?: string;
module_url?: string;
module_external_url?: string;
}

0 comments on commit 56152a6

Please sign in to comment.