refactor menu layout to adapt to conditional menu

This commit is contained in:
Julien Fastré 2018-06-07 21:52:00 +02:00
parent 9bdec6338e
commit f2948e31de
2 changed files with 4 additions and 8 deletions

View File

@ -105,7 +105,7 @@
{% block vertical_menu_content %} {% block vertical_menu_content %}
{{ chill_menu('person', { {{ chill_menu('person', {
'layout': 'ChillPersonBundle::menu.html.twig', 'layout': 'ChillPersonBundle::menu.html.twig',
'args' : {'person_id': person.id }, 'args' : {'person_id': person.id, 'person': person },
'activeRouteKey': activeRouteKey 'activeRouteKey': activeRouteKey
}) }} }) }}

View File

@ -15,13 +15,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
<ul class="tab-nav"> <ul class="tab-nav">
{% for route in routes %} {% for menu in menus %}
<li class="{% spaceless %} <li class="">
{% if route.key == activeRouteKey %} <a href="{{ menu.uri }}" >{{ menu.label }}</a>
active
{% endif %}
{% endspaceless %} ">
<a href="{{ path(route.key, args ) }}" >{{ route.label|trans|upper }}</a>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>