make tabs and submenus working

This commit is contained in:
Julien Fastré 2013-10-31 17:49:38 +01:00
parent 03091a94d6
commit ee1f43d9aa
3 changed files with 20 additions and 5 deletions

View File

@ -3,6 +3,10 @@
chill_person_view:
pattern: /view/{id}
defaults: { _controller: CLChillPersonBundle:Person:view }
options:
menu: person
order: 50
label: menu.person.general_view
chill_person_search:

View File

@ -25,10 +25,15 @@ This view should receive those arguments:
<p class="nationality detail without_nationality">{% trans %}views.Person.view.without_nationality{% endtrans %}</p>
{% endif %}
{{ include("::menu.html.twig", {'person': person, 'menu_composer' : menu_composer }) }}
<section class="tabs vertical">
{{ include("CLChillPersonBundle::menu.html.twig",
{'person': person, 'menu_composer' : menu_composer, 'route_active': 'chill_person_view' }) }}
<div class="tab-content active columns height">
<p>My tab is active so I'll show up first! Inb4 tab 3!</p>
</div>
</section>
{% endblock %}

View File

@ -1,7 +1,13 @@
<div>
<ul>
<ul class="tab-nav follow-href-path columns four">
{% for menu in menu_composer.getRoutesFor('person') %}
<li>{{ path(menu, {'id': person.id}) }}</li>
<li class="{% spaceless %}
{% if menu.route == route_active %}
active
{% endif %}
{% endspaceless %} ">
<a href="{{ path(menu.route, {'id': person.id}) }}" >{{ menu.label }}</a>
</li>
{% endfor %}
</ul>