From: Jérémy Fabre Date: Mon, 25 Jul 2016 10:52:24 +0000 (+0200) Subject: Basicpage template now extends page template. Summary menu first implementation. X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=4a4ddfda36af3825d8f2e78a10bc9cb8d956e82e;p=mezzo.git Basicpage template now extends page template. Summary menu first implementation. --- diff --git a/app/templates/pages/basicpage.html b/app/templates/pages/basicpage.html index 9a954091..1f8fccb8 100644 --- a/app/templates/pages/basicpage.html +++ b/app/templates/pages/basicpage.html @@ -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 %} @@ -26,34 +25,24 @@ {% endeditable %} {% endblock %} -{% block main %} - -
-
- {% editable page.basicpage.title %} -

{{ page.basicpage.title }}

- {% endeditable %} -
-
- -
-
- {% 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 %} -
-
- {% editable page.basicpage.content %} - {{ page.basicpage.content|richtext_filters|safe }} - {% endeditable %} - - {% comment %} - Add the slider here - {% endcomment %} -
-
+ + +{% block page_title %} + + {% editable page.basicpage.title %} +

{{ page.basicpage.title }}

+ {% 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 index 9e503188..00000000 --- a/app/templates/pages/menus/current_tree.html +++ /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 %} - - {% endif %} - {% endif %} - {% endfor %} - {% endif %} - {% if branch_level == 1 %} - {% for page in page_branch %} - - {% endfor %} - {% endif %} - {% if branch_level == 2 %} - {% for page in page_branch %} - {% comment %} - - {% 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 index 00000000..9e503188 --- /dev/null +++ b/app/templates/pages/menus/current_tree_primary.html @@ -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 %} + + {% endif %} + {% endif %} + {% endfor %} + {% endif %} + {% if branch_level == 1 %} + {% for page in page_branch %} + + {% endfor %} + {% endif %} + {% if branch_level == 2 %} + {% for page in page_branch %} + {% comment %} + + {% 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 index 00000000..b8dd8311 --- /dev/null +++ b/app/templates/pages/menus/current_tree_secondary.html @@ -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 %} + + {% 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 %} + + {% page_menu page %} + {% endif %} + {% endfor %} + {% endif %} + {% if branch_level == 2 %} + {% for page in page_branch %} + + {% if page.is_current_or_ascendant %} + {% include "pages/menus/current_tree_summary.html" %} + {% endif %} + {% endfor %} + {% endif %} +{% endif %} +{% endspaceless %} diff --git a/app/templates/pages/menus/current_tree_summary.html b/app/templates/pages/menus/current_tree_summary.html index bb7de2a0..da5b1ab2 100644 --- a/app/templates/pages/menus/current_tree_summary.html +++ b/app/templates/pages/menus/current_tree_summary.html @@ -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 %} - - {% 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 %} - - {% page_menu page %} - {% endif %} - {% endfor %} - {% endif %} - {% if branch_level == 2 %} - {% for page in page_branch %} - - {% 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 %} diff --git a/app/templates/pages/page.html b/app/templates/pages/page.html index b56657f4..f6183ccc 100644 --- a/app/templates/pages/page.html +++ b/app/templates/pages/page.html @@ -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 %} @@ -15,9 +15,31 @@ {{ page.description }} {% endmetablock %}{% endblock %} -{% block title %} -{% editable page.title %}{{ page.title }}{% endeditable %} -{% endblock %} - {% block main %} + +
+
+ {% block page_title %} + {{ page.title }} + {% endblock %} +
+
+
+
+ {% 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 %} +
+
+ {% block page_content %} + {{ page.content }} + {% endblock %} +
+
+ {% endblock %}