Vedangsoft Change Detection
{# Rendered from the DB-backed menu (app/dda/rbac) — resolve_user_menu() already filtered this down to items the current user's role can view, so e.g. the admin entries simply aren't in the list for a non-admin. item_key is the URL with slashes turned into dashes, so each page — including each of the 3 admin pages — gets its own distinct active state and icon instead of being lumped into one generic "admin" key. #} {% set icons = { 'home': '', 'library': '', 'masters': '', 'masters-zones': '', 'masters-villages': '', 'logs': '', 'detect': '', 'reports': '', 'configuration': '', 'admin-roles-users': '', 'admin-modules': '', 'admin-menu': '', 'audit-log': '', 'exception-log': '', } %}
{% for item in menu_items %} {% set item_key = 'configuration' if item.label == 'Configuration' else ('masters' if item.label == 'Masters' else ('home' if item.url == '/' else item.url.strip('/').replace('/', '-'))) %} {% if item.visible_children %} {% set child_keys = [] %} {% for child in item.visible_children %} {% set _ = child_keys.append(child.url.strip('/').replace('/', '-')) %} {% endfor %} {% set group_active = active_page in child_keys %}
{{ (icons.get(item_key) or '')|safe }} {{ item.label }}
{% for child in item.visible_children %} {% set child_key = child.url.strip('/').replace('/', '-') %} {{ (icons.get(child_key) or '')|safe }} {{ child.label }} {% endfor %}
{% else %} {{ (icons.get(item_key) or '')|safe }} {{ item.label }} {% endif %} {% endfor %}
My Profile