def subtract(value, arg):
return value - arg
+@register.as_tag
+def children_pages(page_id):
+ childrens = Page.objects.filter(parent_id=page_id)
+ if childrens:
+ return childrens
+ return None
+
@register.as_tag
def featured_edito(*args):
qs = Page.objects.filter(slug="edito")
{% extends "pages/page.html" %}
-{% load i18n mezzanine_tags keyword_tags featured_tags pages_tags %}
+{% load i18n mezzanine_tags keyword_tags featured_tags pages_tags organization_tags %}
{% block meta_title %}{{ page.meta_title }}{% endblock %}
{% block main %}
{{ block.super }}
+ {% if page.get_ascendants|length == 1 %}
+ {% children_pages page.id as childrens %}
+ {% if childrens %}
+ <div class="container">
+ <div class="row">
+ {% for children in childrens %}
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
+ <a href="{{ children.get_absolute_url }}" title="{{ children.title }}">{{ children.title }}</a>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ {% endif %}
+ {% endif %}
+
{% if page.basicpage.pageblock_set.all %}
<div class="white-bg">
<div class="container">
<hr class="mt0" />
{% for pageblock in page.basicpage.pageblock_set.all %}
<div class="row" data-summary-content>
- <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg">
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg" data-summary-content>
+ {% if not forloop.first %}
+ <hr />
+ {% endif %}
<h2 class="dotted">{{ pageblock.title }}</h2>
{{ pageblock.content|richtext_filters|safe }}
</div>
{% block main %}
{{ block.super }}
+ {% if page.get_ascendants|length == 1 %}
+ {% children_pages page.id as childrens %}
+ {% if childrens %}
+ <div class="container">
+ <div class="row">
+ {% for children in childrens %}
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
+ <a href="{{ children.get_absolute_url }}" title="{{ children.title }}">{{ children.title }}</a>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ {% endif %}
+ {% endif %}
+
{% if page.department.pageblock_set.all %}
<div class="white-bg">
<div class="container">
<hr class="mt0" />
{% for pageblock in page.department.pageblock_set.all %}
<div class="row">
- <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg">
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg" data-summary-content>
+ {% if not forloop.first %}
+ <hr />
+ {% endif %}
<h2 class="dotted">{{ pageblock.title }}</h2>
{{ pageblock.content|richtext_filters|safe }}
</div>
{% block main %}
{{ block.super }}
+ {% if page.get_ascendants|length == 1 %}
+ {% children_pages page.id as childrens %}
+ {% if childrens %}
+ <div class="container">
+ <div class="row">
+ {% for children in childrens %}
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2">
+ <a href="{{ children.get_absolute_url }}" title="{{ children.title }}">{{ children.title }}</a>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ {% endif %}
+ {% endif %}
+
{% if page.team.pageblock_set.all %}
<div class="white-bg">
<div class="container">
<hr class="mt0" />
{% for pageblock in page.team.pageblock_set.all %}
<div class="row">
- <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg">
+ <div class="col-sm-9 col-sm-push-3 col-lg-8 col-lg-push-2 white-bg" data-summary-content>
+ {% if not forloop.first %}
+ <hr />
+ {% endif %}
<h2 class="dotted">{{ pageblock.title }}</h2>
{{ pageblock.content|richtext_filters|safe }}
</div>