{% import 'blocks/macros.html.twig' as macros %}
{% extends 'layouts\\base.html.twig' %}
{% block head %}
{{ encore_entry_link_tags('media-center') }}
{{ parent() }}
{# JSON-LD VideoObject #}
{% set data = {
'@context': 'https://schema.org',
'@type': 'VideoObject',
name: title|default(''),
publisher: {
'@type': 'Organization',
name: 'Conta lá',
logo: {
'@type': 'ImageObject',
url: CDN_URL|default('') ~ get_config('logo_mobile','')|default('')
}
},
datePublished: page.publishDate ? page.publishDate|date('c') : '',
mainEntityOfPage: {
'@type': 'WebPage',
'@id': app.request.getSchemeAndHttpHost() ~ canonicalUrl|raw
}
} %}
{# Image #}
{% if default_image|default %}
{% set data = data|merge({ image: default_image|imagine_filter('news')|urldecode }) %}
{% endif %}
{# Authors #}
{% if page.pageAuthors|length > 0 %}
{% set authors = [] %}
{% for author in page.pageAuthors %}
{% set authors = authors|merge([{ '@type': 'Person', name: author.name|default('') }]) %}
{% endfor %}
{% set data = data|merge({ author: authors }) %}
{% endif %}
{# Render #}
<script type="application/ld+json">{{ data|json_encode(constant('JSON_UNESCAPED_SLASHES'))|raw }}</script>
{% endblock %}
{% block body_class %} class="program program--item"{% endblock %}
{% block content %}
{% set parent_content = parent()|trim %}
{% set pageInfo = get_page_info(app.request.locale, page.id, true, "Temas")|default(null) %}
{% set categories = pageInfo.categories is defined ? pageInfo.categories : null %}
{% set hero = {
title: title|default(null),
hide_title: hide_title|default(null),
summary: short_text|default(null),
logo: logo|default(null),
image: video_thumb|default(null) ?: default_image|default(null) ?: '/uploads/system/placeholder-horizontal.png',
intro: intro|default(null),
trailer: trailer|default(null),
video: video_youtubeid|default(null),
url: url|default(null),
tags: page.tags|default(null)
} %}
{% set exclusiveTag = hero.tags|default([])|filter(t => t.domainValue.type.name == 'Exclusive')|first|default(null) %}
<section class="hero-banner pt-0">
<div class="container">
<div class="hero-banner__content">
{% if hero.logo %}
<h1 class="hero-banner__logo">
{% set extension = hero.logo|extension %}
{% if extension == 'svg' or extension == 'gif' %}
<img loading="lazy" src="{{ CDN_URL|default }}{{ hero.logo }}" alt="{{ hero.title|e }}" title="{{ hero.title|e }}">
{% else %}
<img src="{{ hero.logo|imagine_filter('logo')|urldecode }}" alt="{{ hero.title|e }}" title="{{ hero.title|e }}">
{% endif %}
</h1>
{% elseif not hero.hide_title %}
<h1 class="hero-banner__title">{{ hero.title }}</h1>
{% endif %}
{# ------ TEMAS ----- #}
{% set maxVisible = 5 %}
{% if categories or exclusiveTag %}
<div class="categories">
{{ macros.renderCategoryPopover(categories, maxVisible, false, exclusiveTag, languagecode) }}
</div>
{% endif %}
{# ------ ICONS ----- #}
{% if hero.tags %}
{% set countIcon = 0 %}
<div class="hero-banner__icons">
{% for tag in hero.tags if countIcon < 3 %}
{% if tag.domainValue is defined
and tag.domainValue.type is defined
and tag.domainValue.type.value == 'Atributos de Visualização'
and tag.domainValue.icon is defined %}
{# <span><img src="{{ asset(tag.domainValue.icon) }}" alt=""></span> #}
<span><img src="{{ CDN_URL }}{{ tag.domainValue.icon }}" alt="{{ tag.domainValue.description|e }}"></span>
{% set countIcon = countIcon + 1 %}
{% endif %}
{% endfor %}
</div>
{% endif %}
{# ------ DESCRIPTION ----- #}
{% if hero.summary %}<p class="hero-banner__summary">{{ hero.summary|raw }}</p>{% endif %}
{# ------ AUTHORS ----- #}
{% include 'partials/elements/authors.twig' %}
{# ------ ACTIONS ----- #}
<div class="hero-banner__actions">
{% if hero.video %}
<a class="btn btn-secondary" data-video-id="{{ hero.video }}" data-page-id="{{ page.id|default(null) }}"><img src="{{asset('custom/transmission-icon.svg', 'global')}}" alt="ícone transmissão" class="btn__icon">{{ 'Ver agora'|trans ({},'custom' ) }}</a>
{% endif %}
{% if hero.trailer %}
<a class="btn btn-primary btn-style-1" data-video-id="{{ hero.trailer }}">{{ 'Ver trailer'|trans ({},'custom' ) }}</a>
{% endif %}
<a role="button" class="pt-1" data-toggle="modal" data-target="#shareModal">
{{ file_get_contents(asset('custom/share-icon.svg', 'global'))|raw }}
</a>
</div>
</div>
{% if hero.intro %}
<button type="button" class="hero-video-bg__volume js-hero-volume" aria-label="Ativar som" aria-pressed="false" title="Ativar som"></button>
{% endif %}
</div>
<div class="hero-banner__cover">
{% if hero.intro %}
<div class="hero-video-bg">
<div id="hero-bg-player" data-video-id="{{ hero.intro }}"></div>
</div>
{% elseif hero.image %}
<picture>
<source media="(min-width: 1200px)" srcset="{{ hero.image|imagine_filter('banner_xl')|urldecode }}">
<source media="(min-width: 992px)" srcset="{{ hero.image|imagine_filter('banner_lg')|urldecode }}">
<source media="(min-width: 768px)" srcset="{{ hero.image|imagine_filter('banner_md')|urldecode }}">
<source media="(min-width: 576px)" srcset="{{ hero.image|imagine_filter('banner_sm')|urldecode }}">
<img src="{{ hero.image|imagine_filter('banner_xs')|urldecode }}"
loading="lazy"
alt="{{ hero.title|e }}" fetchpriority="high">
</picture>
{% endif %}
</div>
{% include 'blocks/block_share_modal/block_share_modal.default.html.twig' %}
</section>
{# ------ TAGS BAR ----- #}
<section class="tags-bar">
<div class="container">
<div class="tags-bar__title">{{ 'related_tags'|trans ({},'custom' )|html_entity_decode|raw }}</div>
<div class="tags-bar__content tags-list">
{% set tags = page.tags|default(null)%}
{% if tags is iterable and tags|length %}
{% for tag in tags %}
{% if tag.domainValue is defined
and tag.domainValue.type is defined
and tag.domainValue.machineName is defined
and tag.domainValue.machineName != 'programas'
and (tag.domainValue.type.value == 'Genérico'
or tag.domainValue.type.value == 'Localização'
or tag.domainValue.type.value == 'Tipo de Programa') %}
{% if tag.domainValue.description is defined and tag.domainValue.description is not empty %}
<div><a class="tag" role="button" href="/pt/pesquisa?tags[]={{ tag.domainValue.machineName|e }}">{{ tag.domainValue.description }}</a></div>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</div>
</div>
</section>
{# Blocos #}
{{ parent_content|raw }}
{# Snippet Veja também #}
{% set snippet = render(controller('App\\Controller\\PageContentController::renderSnippet', {"stdSnippets": get_config('snippet_programs',''), "pageId": page.id})) %}
{% if snippet|default %}
{{snippet|raw}}
{% endif %}
{% endblock %}
{% block scripts %}
{{ parent() }}
{{ encore_entry_script_tags('media-center') }}
{% endblock %}