{% extends 'knp_menu.html.twig' %}
{% block label %}
{#% if item.labelAttribute('icon') %}{% endif %#}
{% if not item.labelAttribute('iconOnly') %}
{% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|trans|raw }}{% else %}{{ item.label|trans }}{% endif %}
{% endif %}
{#% if item.labelAttribute('data-image') %}{% endif %#}
{#% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
{% endif %#}
{% endblock %}
{% block list %}
{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
{% import "knp_menu.html.twig" as macros %}
{% if matcher.isAncestor(item) %}
{%- set listAttributes = listAttributes|merge({class: (listAttributes.class|default('') ~ ' in')|trim}) -%}
{% endif %}
{% if not item.isRoot %}
{%- set listAttributes = listAttributes|merge({class: (listAttributes.class|default('') ~ ' treeview-menu')|trim}) -%}
{% endif %}
{% if item.name == 'Sensibilité par ministère' %} {% if is_granted('ROLE_MANAGER') %} Sensibilité par entité {% elseif app.user.direction %} Sensibilité du ministère {% elseif app.user.commune %} Sensibilité de la commune {% elseif is_granted('ROLE_DDD') %} Sensibilité par commune {% endif %} {% elseif item.name == 'Ministère / ODD' %} {% if is_granted('ROLE_MANAGER') %} Structure / ODD {% elseif app.user.direction %} Ministère / ODD {% elseif app.user.commune %} Commune / ODD {% elseif is_granted('ROLE_DDD') %} Commune / ODD {% endif %} {% elseif item.name == 'Ministère / Cible' %} {% if is_granted('ROLE_MANAGER') %} Structure / Cible {% elseif app.user.direction %} Ministère / Cible {% elseif app.user.commune %} Commune / Cible {% elseif is_granted('ROLE_DDD') %} Commune / Cible {% endif %} {% elseif item.name == 'ODD / Ministère' %} {% if is_granted('ROLE_MANAGER') %} ODD / Structure {% elseif app.user.direction %} ODD / Ministère {% elseif app.user.commune %} ODD / Commune {% elseif is_granted('ROLE_DDD') %} ODD / Commune {% endif %} {% elseif item.name == 'Activité / Ministère' %} {% if is_granted('ROLE_MANAGER') %} Activités / Structure {% elseif app.user.direction %} Activités / Ministère {% elseif app.user.commune %} Activités / Commune {% elseif is_granted('ROLE_DDD') %} Activités / Commune {% endif %} {% elseif item.name == 'Validation du PTA' %} {% if is_granted('ROLE_FOCAL') and app.user.commune %} Soumission du PTA {% else %} Validation du PTA {% endif %} {% else %} {{ block('label') }} {% endif %} {% if item.hasChildren %} {% endif %}
{% endif %} {% endblock %}