{% extends '@NotarisFrontend/layout2017.html.twig' %}
{% if notaryId is defined %}
{% set headTitle = info.header1 | replace({"<BR />":" "}) ~ ' - ' ~ subsite.pageTitle %}
{% else %}
{% set headTitle = subsite.pageTitle %}
{% if section.meta.ogTitle and section.parent and section.parent.meta.ogTitle %}
{% set headTitle = section.meta.ogTitle | trans ~ " | " ~ section.parent.meta.ogTitle | trans %}
{% endif %}
{% set headTitle = headTitle ~ ' ' ~ 'alg_basetitle' | trans %}
{% endif %}
{% set linked_url_nl = url_nl ~ path('notaris_frontend_tv') %}
{% set linked_url_fr = url_fr ~ path('notaris_frontend_tv') %}
{% block title %}
<title>{{ headTitle }}</title>
{% endblock %}
{% set canonicalLink = url_scheme ~ '://www.' ~ _context['url_' ~ locale] ~ path('notaris_frontend_tv_detail', {slug: pageslug}) %}
{% block extralinks %}
<link rel="canonical" href="{{ canonicalLink }}" />
{% endblock %}
{% block extrameta %}
{{ parent() }}
<meta name="keywords" content="{{ section.meta.metaKeywords }}"/>
<meta name="description" lang="{{ locale }}" content="{{ section.meta.metaDescription }}"/>
<meta property="og:title" content="{{ headTitle }}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ canonicalLink }}" />
{% if section.meta.ogDescription %}
<meta property="og:description" content="{{ section.meta.ogDescription }}" />
{% endif %}
{% endblock %}
{% block body %}
<section class="content u-padding-top-large">
{{ include('@NotarisFrontend/module/sidenav.html.twig', {'subsite': subsite }) }}
<div id="content-center" class="content-center-large standard">
<div id="content-center-header">
<article class="niveau3 fillcolor">
<div class="article-content">
<h2>{{ section.title }}</h2>
{{ section.description | raw }}
{% if total %}<p>{{ total }} {{ 'tv_videos_beschikbaar' | trans | raw }}</p>{% endif %}
</div>
</article>
</div>
{% if totalpages > 1 %}
<div class="prevnext-pages border-bottom">
{% if currentpage + 1 != 1 %}
{% if currentpage == 1 %}
<a href="{{ path('notaris_frontend_tv_detail', {'slug': pageslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_tv_detail_page', {'page': currentpage - 1, 'slug': pageslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% endif %}
{% else %}
<span>{{ 'vorige' | trans | raw }}</span>
{% endif %}
{% set count = 0 %}
{% set vispages = 4 %}
{% set index = 0 %}
{% if currentpage + 1 <= 2 %}
{% set start = 1 %}
{% else %}
{% set start = currentpage + 1 - 2 %}
{% set vispages = vispages + 1 %}
{% endif %}
{% if start + 4> totalpages %}
{% set start = totalpages - 3 %}
{% endif %}
{% if start < 1 %}
{% set start = 1 %}
{% endif %}
{% if start != 1 %}
<span>...</span>
{% endif %}
{% for i in start..totalpages %}
{% set count = count + 1 %}
{% if count <= vispages %}
{% set index = i %}
{% if i == currentpage + 1 %}
<span class="current">{{ i }}</span>
{% else %}
{% if i == 1 %}
<a href="{{ path('notaris_frontend_tv_detail', {'slug': pageslug}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('notaris_frontend_tv_detail_page', {'page': i - 1, 'slug': pageslug}) }}">{{ i }}</a>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if index != totalpages %}
<span>...</span>
{% endif %}
{% if currentpage + 1 != totalpages %}
<a href="{{ path('notaris_frontend_tv_detail_page', {'page': currentpage + 1, 'slug': pageslug}) }}">{{ 'volgende' | trans | raw }}</a>
{% else %}
<span>{{ 'volgende' | trans | raw }}</span>
{% endif %}
</div>
{% endif %}
<section id="info" class="no-margin">
<div id="info-content" class="niveau1 info-news-content c-movies">
{% for video in videos %}
<div class="c-movies__item">
<a href="{{ path('notaris_frontend_tv_detail_video', {'slug': pageslug, 'slugvideo': video.slug}) }}" title="{{ video.title }}" class="o-grid__item o-object-fit c-movies__link {% if video.asset.assetImages | length == 0 %}o-grid__item--overlay{% endif %}" data-slug="{{ video.slug }}">
{% if video.asset.assetImages | length > 0 %}
{% set image_path = 'uploads/'~ locale ~ '/' ~ video.asset.assetImages[0].image.filename %}
{{image_path | responsive_image_source([448, 353, 436], {'filterset': 'responsive_article_image', 'sizes': '(min-width: 960px) 448px, (min-width: 768px and max-width: 960px) 353px, (min-width: 480px and max-width: 768px) 436px, (max-width: 480px) 100vw', 'alt': video.title, 'title': video.title}) }}
{% endif %}
<div class="c-movies__overlay">
<div class="o-grid__item__overlay__title c-movies__info">
<h3 class="u-h4">{{ video.title }}</h3>
</div>
<button class="c-btn c-btn--icon c-btn--icon--large c-btn__play">
<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><style>.z{fill:#FFF;}</style><path class="z" d="M1576 927L248 1665q-23 13-39.5 3t-16.5-36V160q0-26 16.5-36t39.5 3l1328 738q23 13 23 31t-23 31z" fill="true"/></svg>
</button>
</div>
<div class="c-movies__info-back">
<span class="c-movies__meta">{{ video.publicationDate | localdate }}</span><br>
<span class="c-movies__meta c-movies__meta--theme">{{ 'tv_rubriek'|trans }}:</span>
<span class="c-movies__meta">{% for subsite in video.subsites %}{{ subsite.subsite.name }}{% if loop.last and not video.isVaria %}{% else %}, {% endif %}{% endfor %}{% if video.isVaria %}{{ 'tv_varia_tekst' | trans }}{% endif %}</span>
</div>
</a>
</div>
{% endfor %}
</div>
</section>
{% if totalpages > 1 %}
<div class="prevnext-pages">
{% if currentpage + 1 != 1 %}
{% if currentpage == 1 %}
<a href="{{ path('notaris_frontend_tv_detail', {'slug': pageslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% else %}
<a href="{{ path('notaris_frontend_tv_detail_page', {'page': currentpage - 1, 'slug': pageslug}) }}">{{ 'vorige' | trans | raw }}</a>
{% endif %}
{% else %}
<span>{{ 'vorige' | trans | raw }}</span>
{% endif %}
{% set count = 0 %}
{% set vispages = 4 %}
{% set index = 0 %}
{% if currentpage + 1 <= 2 %}
{% set start = 1 %}
{% else %}
{% set start = currentpage + 1 - 2 %}
{% set vispages = vispages + 1 %}
{% endif %}
{% if start + 4> totalpages %}
{% set start = totalpages - 3 %}
{% endif %}
{% if start < 1 %}
{% set start = 1 %}
{% endif %}
{% if start != 1 %}
<span>...</span>
{% endif %}
{% for i in start..totalpages %}
{% set count = count + 1 %}
{% if count <= vispages %}
{% set index = i %}
{% if i == currentpage + 1 %}
<span class="current">{{ i }}</span>
{% else %}
{% if i == 1 %}
<a href="{{ path('notaris_frontend_tv_detail', {'slug': pageslug}) }}">{{ i }}</a>
{% else %}
<a href="{{ path('notaris_frontend_tv_detail_page', {'page': i - 1, 'slug': pageslug}) }}">{{ i }}</a>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if index != totalpages %}
<span>...</span>
{% endif %}
{% if currentpage + 1 != totalpages %}
<a href="{{ path('notaris_frontend_tv_detail_page', {'page': currentpage + 1, 'slug': pageslug}) }}">{{ 'volgende' | trans | raw }}</a>
{% else %}
<span>{{ 'volgende' | trans | raw }}</span>
{% endif %}
</div>
{% endif %}
{# dynamische cms modules #}
{{ include('@NotarisFrontend/module/mod_cms.html.twig', {'rightmodules': rightmodules }) }}
</div>
<!-- #### CONTENT #### -->
<!-- modules -->
{#
<aside id="content-right">
{% if notaryId is defined %}
{{ include('@NotarisFrontend/Sven/_sven_address.html.twig') }}
{% else %}
{{ include('@NotarisFrontend/Module/notsearch_module.html.twig') }}
{% endif %}
{% if videosubsite %}
<article class="mod-faq">
<a href="/{{ videosubsite.slug }}" class="module-header">
<h2>{% if videosubsite.slug == 'acheter-louer-emprunter' %}{{ 'tv_allesover2' | trans | raw }}{% else %}{{ 'tv_allesover' | trans | raw }}{% endif %} {{ videosubsite.name | lower }}</h2>
</a>
<a href="/{{ videosubsite.slug }}" class="module-content">
</a>
<div class="cleaner"> </div>
</article>
{% endif %}
{{ include('@NotarisFrontend/Module/Side/glossary.html.twig', {'subsite': subsite, 'glossary': glossary}) }}
{{ include('@NotarisFrontend/Module/Side/faq.html.twig', {'subsite': subsite, 'faq': faq }) }}
{{ include('@NotarisFrontend/Module/mod_cms.html.twig', {'rightmodules': rightmodules }) }}
<div class="cleaner"> </div>
</aside>
#}
{% include '@NotarisFrontend/navigation/mobilesubnav.html.twig' with {'websiteSlug': subsite.slug, 'isSven':false, 'isHome':false, 'subsite': subsite} %}
</section>
{% endblock %}
{% block extrajs %}
<script>
//adresbook();
$(document).ready(function(){
$('.info-news-content a').click(function(e){
e.preventDefault();
var href = $(this).attr('href');
var slug = $(this).attr('data-slug');
$.getJSON('{{ path('notaris_frontend_tv_clicked') }}/' + slug, function(result){
window.location.href = href;
});
});
});
</script>
{% endblock %}