]> git.parisson.com Git - mezzo.git/commitdiff
Fix current tree primary
authorJérémy Fabre <Jeremy@iMac-de-Jeremy.local>
Tue, 8 Nov 2016 10:32:08 +0000 (11:32 +0100)
committerJérémy Fabre <Jeremy@iMac-de-Jeremy.local>
Tue, 8 Nov 2016 10:32:08 +0000 (11:32 +0100)
app/templates/pages/menus/current_tree_primary.html

index 3bddf3df6d198531b0197d869474222715fd00d7..8011bee26ba34ada95e2fb625c904fb32df4a206 100644 (file)
@@ -5,9 +5,11 @@
     {% with page as current_page %}
         {% if branch_level == 0 %}
             {% for page in page_branch %}
+                {% if forloop.first %}
+                    <ul class="nav-tree nav-tree--level-{{ branch_level }}" data-sticky data-sticky-parent="page" data-sticky-offset="100" data-sticky-detach-at="971">
+                {% endif %}
                 {% if page.in_menu and page.has_children_in_menu %}
                     {% if page.is_primary and page.is_current_or_ascendant %}
-                    <ul class="nav-tree nav-tree--level-{{ branch_level }}" data-sticky data-sticky-parent="page" data-sticky-offset="100" data-sticky-detach-at="971">
                         <li class="nav-tree__item">
                             <a class="nav-tree__link{% if page.is_current %} active{% endif %}" href="{{ page.get_absolute_url }}">{% trans 'Accueil' %}</a>
                         </li>
                         {% endif %}
                     {% endif %}
                     {% if page.is_primary and page.is_current_or_ascendant %}
-                    </ul>
                     {% endif %}
                 {% elif page.in_menu and current_page.in_menus == page.in_menus %}
-                    {{ page.title }} {{ page.in_menus }}
+                    <li class="nav-tree__item">
+                        <a class="nav-tree__link{% if page.is_current %} active{% endif %}" href="{{ page.get_absolute_url }}">{{page.title}}</a>
+                    </li>
+                {% endif %}
+                {% if forloop.last %}
+                    </ul>
                 {% endif %}
             {% endfor %}
         {% endif %}