{% extends 'layout.html.twig' %}
{% block title %}{{ page.pageTitle|e('html') }}{% endblock %}
{% block description %}{{ page.pageDescription }}{% endblock %}
{% block body_class %}local-pages{% endblock %}
{% block breadcrumb %}
<div id="breadcrumb">
<div class="container">
<div class="row">
<ul class="col-sm-12">
<li><a href="{{ path('public_index') }}">Accueil</a></li>
<li class="current">Pages locales</li>
</ul>
</div>
</div>
</div>
<div style="height: 0px;overflow: hidden;">
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope
itemtype="http://schema.org/ListItem">
<a itemscope itemtype="http://schema.org/Thing"
itemprop="item" href="{{ app.request.uri }}" itemid="pages-locales">
<span itemprop="name">Pages Locales</span>
</a>
<meta itemprop="position" content="1" />
</li>
</ol>
</div>
{% endblock %}
{% block content %}
<div id="local-pages" class="page container">
<div class="row">
<div class="title col-sm-12">
<h1>Pages locales</h1>
</div>
<div class="content col-sm-12">
{{ page.content|raw }}
{% set last_title = '' %}
{% set last_subtitle = '' %}
{% for item in pages %}
{% if item.region != last_title %}
{% if last_title is not empty %}{{ '</div>' }}{% endif %}
{{ '<div class="region">' }}
<h2>
{{- item.region -}}
{%- if item.region == item.departement -%}
({{ item.code }})
{%- endif -%}
</h2>
{% set last_title = item.region %}
{% set last_subtitle = '' %}
{% endif %}
{% if item.departement != last_subtitle %}
{% if item.departement != item.region %}
<h3>{{ item.departement }} ({{ item.code }})</h3>
{% set last_subtitle = item.departement %}
{% endif %}
{% if item.prestataires > 0 %}
<p>
<a href="{{ path('public_local_page_departement', {'departement': item.slug, 'cp': item.code}) }}">
<b>Diagnostiqueurs immobiliers {{ item.departement }}</b>
</a>
</p>
{% endif %}
{% endif %}
{% if item.title is not null and item.cp is not null %}
<p>
<a href="{{ routeLocalPage(item.cp, item.title|sanitize) }}">
{{- 'Diagnostic immobilier ' ~ item.title -}}
</a>
</p>
{% endif %}
{% endfor %}
{{ '</div>' }}
</div>
</div>
</div>
{% endblock %}