Skip to content

Commit

Permalink
- Show "Monitoring & Analytics" menu item only when "MONITORING_ENAB…
Browse files Browse the repository at this point in the history
…LED=True"
  • Loading branch information
afabiani committed Oct 27, 2021
1 parent 9293512 commit 0d3e632
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions geonode_mapstore_client/templatetags/get_menu_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ def get_user_menu(context):
"label": "Log out"
}
]
monitoring = []
if settings.MONITORING_ENABLED:
monitoring = [
devider,
{
"type": "link",
"href": "/monitoring/",
"label": "Monitoring & Analytics"
}
]
admin_only = [
{
"type": "link",
Expand All @@ -176,15 +186,8 @@ def get_user_menu(context):
"type": "link",
"href": "/geoserver/",
"label": "GeoServer"
},
devider,
{
"type": "link",
"href": "/monitoring/",
"label": "Monitoring & Analytics"
},
devider,
] + general
}
] + monitoring + [devider] + general

if user.is_superuser:
profile['items'].extend(admin_only)
Expand Down

0 comments on commit 0d3e632

Please sign in to comment.