]> git.parisson.com Git - mezzo.git/commitdiff
Basicpage template now extends page template. Summary menu first implementation.
authorJérémy Fabre <blackmagik88@gmail.com>
Mon, 25 Jul 2016 10:52:24 +0000 (12:52 +0200)
committerJérémy Fabre <blackmagik88@gmail.com>
Mon, 25 Jul 2016 10:52:24 +0000 (12:52 +0200)
app/templates/pages/basicpage.html
app/templates/pages/menus/current_tree.html [deleted file]
app/templates/pages/menus/current_tree_primary.html [new file with mode: 0644]
app/templates/pages/menus/current_tree_secondary.html [new file with mode: 0644]
app/templates/pages/menus/current_tree_summary.html
app/templates/pages/page.html

index 9a95409128d35340c1f769ad306a524317b61106..1f8fccb8854aa72d02bdb823f711741d6ba7184f 100644 (file)
@@ -1,5 +1,4 @@
-{% extends "base.html" %}
-
+{% extends "pages/page.html" %}
 {% load i18n mezzanine_tags keyword_tags featured_tags pages_tags %}
 
 {% block meta_title %}{{ page.meta_title }}{% endblock %}
     {% endeditable %}
 {% endblock %}
 
-{% block main %}
-
-    <div class="row">
-        <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
-            {% editable page.basicpage.title %}
-                <h1 class="dotted">{{ page.basicpage.title }}</h1>
-            {% endeditable %}
-        </div>
-    </div>
-
-    <div class="row">
-        <div class="col-sm-3 col-lg-2">
-            {% 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>
+
+
+{% block page_title %}
+
+    {% editable page.basicpage.title %}
+        <h1 class="dotted">{{ page.basicpage.title }}</h1>
+    {% endeditable %}
+
+{% endblock %}
+
+{% block page_content %}
+
+    {% editable page.basicpage.content %}
+        {{ page.basicpage.content|richtext_filters|safe }}
+    {% endeditable %}
+
+    {% comment %}
+        Add the slider here
+    {% endcomment %}
 
 {% endblock %}
diff --git a/app/templates/pages/menus/current_tree.html b/app/templates/pages/menus/current_tree.html
deleted file mode 100644 (file)
index 9e50318..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-{% 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">
-                    <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 %}
-                {% 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 %}
-            <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>
-                {% if page.is_current_or_ascendant and page.has_children_in_menu %}
-                    <ul class="nav-tree nav-tree--level-{{ branch_level }}">
-                        {% page_menu page %}
-                    </ul>
-                {% endif %}
-            </li>
-        {% endfor %}
-    {% 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 %}
-{% endspaceless %}
diff --git a/app/templates/pages/menus/current_tree_primary.html b/app/templates/pages/menus/current_tree_primary.html
new file mode 100644 (file)
index 0000000..9e50318
--- /dev/null
@@ -0,0 +1,47 @@
+{% 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">
+                    <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 %}
+                {% 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 %}
+            <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>
+                {% if page.is_current_or_ascendant and page.has_children_in_menu %}
+                    <ul class="nav-tree nav-tree--level-{{ branch_level }}">
+                        {% page_menu page %}
+                    </ul>
+                {% endif %}
+            </li>
+        {% endfor %}
+    {% 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 %}
+{% endspaceless %}
diff --git a/app/templates/pages/menus/current_tree_secondary.html b/app/templates/pages/menus/current_tree_secondary.html
new file mode 100644 (file)
index 0000000..b8dd831
--- /dev/null
@@ -0,0 +1,43 @@
+{% 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 %}
+                {% include "pages/menus/current_tree_summary.html" %}
+            {% endif %}
+        {% endfor %}
+    {% endif %}
+{% endif %}
+{% endspaceless %}
index bb7de2a0916d0a9b216cf5e23484a1b5102233ce..da5b1ab2b3cd0e8beb5d873ecdc90f2b8219869d 100644 (file)
@@ -1,45 +1,3 @@
-{% 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 %}
+{% comment %}
+We will use JS to populate the menu
+{% endcomment %}
index b56657f4f7f79b393a67d9f4c87a7baf8a1255e0..f6183ccc3344a5db24696ff4b9ae880325544873 100644 (file)
@@ -1,5 +1,5 @@
 {% extends "base.html" %}
-{% load i18n mezzanine_tags keyword_tags featured_tags %}
+{% load i18n mezzanine_tags keyword_tags featured_tags pages_tags %}
 
 {% block meta_title %}{{ page.meta_title }}{% endblock %}
 
 {{ page.description }}
 {% endmetablock %}{% endblock %}
 
-{% block title %}
-{% editable page.title %}{{ page.title }}{% endeditable %}
-{% endblock %}
-
 {% block main %}
+
+    <div class="row">
+        <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
+            {% block page_title %}
+                {{ page.title }}
+            {% endblock %}
+        </div>
+    </div>
+    <div class="row">
+        <div class="col-sm-3 col-lg-2">
+            {% block page_sidebar %}
+                {% if page.get_ascendants|length < 2 %}
+                    {% page_menu "pages/menus/current_tree_primary.html" %}
+                {% endif %}
+                {% if page.get_ascendants|length == 2 %}
+                    {% page_menu "pages/menus/current_tree_secondary.html" %}
+                {% endif %}
+            {% endblock %}
+        </div>
+        <div class="col-sm-9 col-lg-8">
+            {% block page_content %}
+                {{ page.content }}
+            {% endblock %}
+        </div>
+    </div>
+
 {% endblock %}