]> git.parisson.com Git - mezzo.git/commitdiff
Add summary tree (no content for the moment)
authorJérémy Fabre <blackmagik88@gmail.com>
Mon, 25 Jul 2016 09:25:36 +0000 (11:25 +0200)
committerJérémy Fabre <blackmagik88@gmail.com>
Mon, 25 Jul 2016 09:25:36 +0000 (11:25 +0200)
app/templates/pages/basicpage.html
app/templates/pages/menus/current_tree.html
app/templates/pages/menus/current_tree_summary.html [new file with mode: 0644]

index 24d805abbab256e6b47072d86ba1ab02d28f8262..9a95409128d35340c1f769ad306a524317b61106 100644 (file)
@@ -1,4 +1,5 @@
 {% extends "base.html" %}
+
 {% load i18n mezzanine_tags keyword_tags featured_tags pages_tags %}
 
 {% block meta_title %}{{ page.meta_title }}{% endblock %}
 
     <div class="row">
         <div class="col-sm-3 col-lg-2">
-            {% page_menu "pages/menus/current_tree.html" %}
+            {% if page.get_ascendants|length < 2 %}
+                {% page_menu "pages/menus/current_tree.html" %}
+            {% endif %}
+            {% if page.get_ascendants|length == 2 %}
+                {% page_menu "pages/menus/current_tree_summary.html" %}
+            {% endif %}
         </div>
         <div class="col-sm-9 col-lg-8">
             {% editable page.basicpage.content %}
                 {{ page.basicpage.content|richtext_filters|safe }}
             {% endeditable %}
+
+            {% comment %}
+                Add the slider here
+            {% endcomment %}
         </div>
     </div>
 
index 244275c088f624e69113d19e6eeae97a00e6f358..9e503188a27ec83be12ccae286390cf10a4bf655 100644 (file)
@@ -8,7 +8,7 @@
                 {% if page.is_primary and page.is_current_or_ascendant %}
                 <ul class="nav-tree nav-tree--level-{{ branch_level }}" data-sticky data-sticky-parent="row" 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 }}">Accueil</a>
+                        <a class="nav-tree__link{% if page.is_current %} active{% endif %}" href="{{ page.get_absolute_url }}">{% trans 'Accueil' %}</a>
                     </li>
                 {% endif %}
                 {% if page.is_current_or_ascendant %}
     {% endif %}
     {% if branch_level == 2 %}
         {% for page in page_branch %}
+            {% comment %}
             <li class="nav-tree__item nav-tree__item--sub">
                 <a class="nav-tree__link nav-tree__link--sub" href="{{ page.get_absolute_url }}">{{ page.title }}</a>
             </li>
+            {% endcomment %}
         {% endfor %}
     {% endif %}
 {% endif %}
diff --git a/app/templates/pages/menus/current_tree_summary.html b/app/templates/pages/menus/current_tree_summary.html
new file mode 100644 (file)
index 0000000..bb7de2a
--- /dev/null
@@ -0,0 +1,45 @@
+{% load i18n pages_tags %}
+
+{% spaceless %}
+{% if page_branch_in_menu %}
+    {% if branch_level == 0 %}
+        {% for page in page_branch %}
+            {% 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="row" data-sticky-offset="100" data-sticky-detach-at="971">
+                {% endif %}
+                {% if page.is_current_or_ascendant %}
+                    {% if page.has_children_in_menu %}
+                        {% page_menu page %}
+                    {% endif %}
+                {% endif %}
+                {% if page.is_primary and page.is_current_or_ascendant %}
+                </ul>
+                {% endif %}
+            {% endif %}
+        {% endfor %}
+    {% endif %}
+    {% if branch_level == 1 %}
+        {% for page in page_branch %}
+            {% if page.is_current_or_ascendant and page.has_children_in_menu %}
+                <li class="nav-tree__item">
+                    <a class="nav-tree__link" href="{{ page.get_absolute_url }}">{% trans 'Accueil' %}</a>
+                </li>
+                {% page_menu page %}
+            {% endif %}
+        {% endfor %}
+    {% endif %}
+    {% if branch_level == 2 %}
+        {% for page in page_branch %}
+            <li class="nav-tree__item">
+                <a class="nav-tree__link{% if page.is_current or page.is_current_or_ascendant %} active{% endif %}" href="{{ page.get_absolute_url }}">{{ page.title }}</a>
+            </li>
+            {% if page.is_current_or_ascendant %}
+                {% if page.has_children_in_menu %}
+                    {% page_menu page %}
+                {% endif %}
+            {% endif %}
+        {% endfor %}
+    {% endif %}
+{% endif %}
+{% endspaceless %}