<header class="header {% block header_class %}hs_1{% endblock %}">
<div class="line-1">
<div class="logo-mini">
<a {% if get_config('logo_link','')|default %} href="/" {% else %}{% endif %} aria-label="{{ get_config('default_meta_page_name',app.request.getLocale())|default }}">
{# {{ file_get_contents(asset('custom/mini-norte.svg', 'global'))|raw }} #}
{% if get_config('logo_mobile','')|default %}
<img src="{{CDN_URL|default}}{{get_config('logo_mobile','')|default}}" alt="{{ get_config('default_meta_page_name',app.request.getLocale())|default }} Logo" class="d-lg-none">
{% endif %}
{# <img src="{{CDN_URL|default}}{{get_config('logomini_portugal','')|default(asset('none.png', 'global'))}}" alt="{{ get_config('default_meta_page_name',app.request.getLocale())|default }} Logo"{% if get_config('logo_mobile','')|default %} class="d-none d-lg-block"{% endif %} > #}
<img
src="{{ asset('custom/logomenu_contala_scroll.svg', 'global') }}"
alt="logo-mini"
{% if get_config('logo_mobile','')|default %} class="d-none d-lg-block"{% endif %} >
</a>
</div>
{# OLD TERRITORY #}
{# <div class="territory">#}
{# <span class="primary-300">#}
{# <a href="/">{{ 'conta_la'|trans ({},'custom' )|html_entity_decode|raw }}</a>#}
{# </span>#}
{# <div class="select-territory ">#}
{# <div class="selected js-select-territory">#}
{# <div>Portugal</div>#}
{# <div class="arrow">#}
{# {{ file_get_contents(asset('custom/arrow-down-icon.svg', 'global'))|raw }}#}
{# </div>#}
{# </div>#}
{# <ul class="card card-blur options">#}
{# <li><a href="#">Portugal</a></li>#}
{# <li><a href="#">Norte</a></li>#}
{# <li><a href="#">Centro</a></li>#}
{# <li><a href="#">Sul</a></li>#}
{# <li><a href="#">Rural</a></li>#}
{# </ul>#}
{# </div>#}
{# </div>#}
{% include "partials\\variants\\explore-watchtv.html.twig" %}
<div class="weather"></div>
<div class="menu-top2">
<ul class="navbar-nav">
{{ render(controller('App\\Controller\\PageContentController::RenderMenu',[], {'menu': "menutop2"}) ) }}
</ul>
</div>
{% include "partials\\elements\\languages.twig" %}
{% if get_config('results_pages', '')|default %}
<div class="search">
<a href="#" class="js-search-bt" aria-label="{{ 'acess_to_search'|trans ({},'custom' )|html_entity_decode|raw }}">
{{ file_get_contents(asset('custom/search-icon.svg', 'global'))|raw }}
</a>
</div>
{% endif %}
{# TEMPORARY REMOVAL FOR v1.0 #}
{# {% if app.user is not null and app.user is instanceof('App\\Admin\\Entity\\StdWebUsers') %}#}
{# <div class="favorits">Favoritos</div>#}
{# {% endif %}#}
{# {% include "partials\\elements\\webusers.twig" %}#}
<div class="col-menu-mobile">
<button class="js-menumobile-hamburger" aria-label="menu button" type="button">
<span class="hamburger-box">
<span class="hamburger-inner"></span>
</span>
</button>
</div>
</div>
{% if get_config('notificationsbar_page', '')|default %}
<div class="line-2">
{% block notificationsbar %}
{% include "partials\\elements\\notifications.twig" %}
{% endblock %}
</div>
{% endif %}
<div class="{% if get_config('container_fluid','')|default %}container-fluid{% else %}container{% endif %}{% if get_config('showdesktophamburguermenu','')|default %} position-relative align-items-center{% endif %} last-line">
<div class="grid">
<div class="logo">
<a {% if get_config('logo_link','')|default %} href="/" {% else %}{% endif %} aria-label="{{ get_config('default_meta_page_name',app.request.getLocale())|default }}">
{# {% if get_config('logo_mobile','')|default %}
<img src="{{CDN_URL|default}}{{get_config('logo_mobile','')|default}}" alt="{{ get_config('default_meta_page_name',app.request.getLocale())|default }} Logo" class="d-lg-none">
{% endif %} #}
<img src="{{CDN_URL|default}}{{get_config('logo','')|default(asset('none.png', 'global'))}}" alt="{{ get_config('default_meta_page_name',app.request.getLocale())|default }} Logo" class="logo__default" >
<img src="{{CDN_URL|default}}{{get_config('logo_transparent_header','')|default(get_config('logo',''))|default(asset('none.png', 'global'))}}" alt="{{ get_config('default_meta_page_name',app.request.getLocale())|default }} Logo" class="logo__transparent">
</a>
</div>
{% include "partials\\variants\\explore-watchtv.html.twig" %}
<div class="menu-top2">
<ul class="navbar-nav">
{{ render(controller('App\\Controller\\PageContentController::RenderMenu',[], {'menu': "menutop2"}) ) }}
</ul>
</div>
</div>
</div>
<div class="menu-mobile">
{% if get_config('menubackgroundvideo','')|default and get_config('desktophamburguermenustyle','') == "full_width_menu" %}
<div class="underlay">
<video autoplay muted loop playsinline src="{{ CDN_URL ~ get_config('menubackgroundvideo','') }}" type="video/mp4" class="d-none d-lg-block"></video>
<div class="mask d-none d-lg-block"></div>
</div>
{% endif %}
<div class="mwrapper">
<ul class="navbar-nav">
{{ render(controller('App\\Controller\\PageContentController::RenderMenu',[], {'menu': "menumobile"}) ) }}
</ul>
</div>
{% if get_config('contact_pages',"")|default %}
{% set contactpage = get_page_info(app.request.locale,get_config('contact_pages',"")) %}
<div class="btn-fixed-bottom">
<a href="{{contactpage.url}}">
<span>{{contactpage.title}}</span>
</a>
</div>
{% endif %}
{% if alternateUrls|length > 1 %}
<div class="lang d-flex">
{% for alternateUrl in alternateUrls %}
<a class="{% if alternateUrl.language_code == locale %}active{% endif %}" href="{{alternateUrl.url|raw}}">
{{alternateUrl.language_code|default}}
</a>
{% endfor %}
</div>
{% endif %}
</div>
<div class="explore-pannel" data-api-url="{{ path('api_explore_options') }}?locale={{ app.request.locale }}">
<div class="explore-pannel-body h-100 custom-scroll">
<div class="container">
<div class="row h-100 py-lg-5">
<div class="col-auto col-explore-pannel-body-logowidth d-none d-lg-block">
<div class="explore-pannel-body-logowidth"></div>
</div>
<div class="col col-search">
<form id="formexplore" class="explore-pannel-body-generalsearch" action="/pt/pesquisa" method="get">
<div>
<button id="btn_explore_close" class="trigger-explore js-explore-bt">
<i class="fa-solid fa-xmark"></i>
<span>{{ 'close'|trans ({},'custom' )|html_entity_decode|raw }}</span>
</button>
</div>
{# Pesquisa livre #}
<div class="form-group search-themes">
<label for="searchbox" class="title-from-group">{{ 'label_explore_search'|trans ({},'custom' )|html_entity_decode|raw }}</label>
<div class="wrapp-searchbox">
<select id="searchbox" class="selectpicker customselectpicker form-control" multiple data-live-search="true" title="{{ 'placeholder_explore_search'|trans ({},'custom' ) }}">
{# {% for i in 1..3 %}
<optgroup label="Tema {{ i }}">
<option value="Tema {{ i }}" class="theme d-none">Tema {{ i }}</option>
<option value="Sub-Tema.{{ i }}.1" class="subtheme">Sub-Tema.{{ i }}.1</option>
<option value="Sub-Tema.{{ i }}.2" class="subtheme">Sub-Tema.{{ i }}.2</option>
<option value="Sub-Tema.{{ i }}.3" class="subtheme">Sub-Tema.{{ i }}.3</option>
<option value="Sub-Tema.{{ i }}.4" class="subtheme">Sub-Tema.{{ i }}.4</option>
</optgroup>
{% endfor %} #}
{# Options are populated dynamically from /api/explore/options (Temas tree) #}
</select>
</div>
</div>
{# (Tags moved below content_type) #}
{# Temas #}
<div class="form-group themes">
<div class="title-from-group d-flex justify-content-between align-items-center">
<span>{{ 'main_themes'|trans ({},'custom' )|html_entity_decode|raw }}</span>
<button type="button" class="border-0 bg-transparent btn-primary btn-style-1" onclick="clearCheckboxes('themes[]')">
{{ 'clear'|trans({},'custom')|default('Reset filters') }}
</button>
</div>
<div id="write-themes-box">
{# <div class="form-check-inline">
<label class="form-check-label" for="politica">
<input type="checkbox" class="form-check-input" id="politica" name="themes[]" value="Politica" checked>Política
</label>
</div>
#}
</div>
</div>
{# Sub-temas - kept for JS compatibility, hidden with CSS #}
<div class="form-group sub-themes" style="display: none;">
<div class="title-from-group d-flex justify-content-between align-items-center">
<span>{{ 'sub_themes'|trans ({},'custom' )|html_entity_decode|raw }}</span>
<button type="button" class="border-0 bg-transparent btn-primary btn-style-1" onclick="clearCheckboxes('subthemes[]')">
{{ 'clear'|trans({},'custom')|default('Reset filters') }}
</button>
</div>
<div id="write-subthemes-box">
</div>
</div>
<div class="separator"></div>
{# Formatos #}
{# Tags searchable (now placed under content_type) #}
<div class="form-group tags-group">
<div class="title-from-group">
{{ 'label_explore_tag_search'|trans({},'custom')|default('Procura algo mais específico?')|html_entity_decode|raw }}
</div>
<div class="wrapp-searchbox">
<select id="explore-tags" class="selectpicker customselectpicker form-control" multiple data-live-search="true" title="{{ 'placeholder_explore_tag_search'|trans({},'custom')|default('Selecione aqui as tags') }}"></select>
</div>
</div>
<div class="form-group selected-tags">
<div class="title-from-group d-flex justify-content-between align-items-center">
<span>{{ 'selected_tags'|trans({},'custom')|default('Tag(s)')|html_entity_decode|raw }}</span>
<button type="button" class="border-0 bg-transparent btn-primary btn-style-1" onclick="clearCheckboxes('tags[]')">
{{ 'clear'|trans({},'custom')|default('Reset filters') }}
</button>
</div>
<div id="write-tags-box"></div>
</div>
<div class="separator"></div>
{# Formatos #}
{% set filterKeys = app.request.query.get('content_type') %}
<div class="form-group content_type">
<div class="title-from-group">{{ 'content_types'|trans ({},'custom' )|html_entity_decode|raw }}</div>
<div class="form-check-inline">
<label class="content_type_label" for="noticiais">
<input
type="checkbox"
class="form-check-input content_type_option"
id="noticiais"
name="content_type[]"
value="news"
{% if filterKeys is defined and filterKeys is iterable and 'news' in filterKeys %} checked {% endif %}
>Notícias
</label>
</div>
<div class="form-check-inline">
<label class="content_type_label" for="news_reports">
<input
type="checkbox"
class="form-check-input content_type_option"
id="news_reports"
name="content_type[]"
value="news_reports"
{% if filterKeys is defined and filterKeys is iterable and 'news_reports' in filterKeys %} checked {% endif %}
>Reportagens
</label>
</div>
<div class="form-check-inline">
<label class="content_type_label" for="programs">
<input
type="checkbox"
class="form-check-input content_type_option"
id="programs"
name="content_type[]"
value="programs"
{% if filterKeys is defined and filterKeys is iterable and 'programs' in filterKeys %} checked {% endif %}
>Programas
</label>
</div>
<div class="form-check-inline">
<label class="content_type_label" for="event">
<input
type="checkbox"
class="form-check-input content_type_option"
id="event"
name="content_type[]"
value="event"
{% if filterKeys is defined and filterKeys is iterable and 'event' in filterKeys %} checked {% endif %}
>Eventos
</label>
</div>
</div>
<div class="explore-pannel-body-generalsearch-footer">
<div class="container">
<div class="row">
<div class="col">
<div class="actions">
<button type="button" class="reset2 js-reset-filters" onclick="clearAllContent()">
{{ 'clear_all_filters'|trans ({},'custom' )|html_entity_decode|raw }}
</button>
<button type="submit" class="btn-secondary">{{ 'apply'|trans ({},'custom' )|html_entity_decode|raw }}</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% if get_config('results_pages', '')|default %}
{% set searchpage=get_page_info(app.request.locale,get_config('results_pages','')) %}
<div class="search-pannel">
<div class="search-pannel-body container">
<div class="row">
<div class="col-auto d-none d-lg-block">
<div class="search-pannel-body-logowidth"></div>
</div>
<div class="col col-search">
<form action="{{searchpage.url|default('#')}}" class="search-pannel-body-generalsearch">
<input type="search" name="p" placeholder="{{ 'placeholder_search'|trans ({},'custom' )|html_entity_decode|raw }}" class="form-control">
<button id="btn-search-submit" type="submit" class="btn btn-secondary" disabled>
<span>{{ 'search_btn'|trans ({},'custom' )|html_entity_decode|raw }}</span>
</button>
<button id="btn-search-close" class="js-search-bt">
<i class="fa-solid fa-xmark"></i>
<span>Fechar</span>
</button>
</form>
</div>
</div>
</div>
</div>
{% endif %}
</header>
<script>
// Search field validation (keep this inline as it's template-specific)
document.addEventListener('DOMContentLoaded', function () {
const searchField = document.getElementsByName('p')[0];
const searchBtn = document.getElementById('btn-search-submit');
if (searchField) {
// Prevenir Enter apenas se o campo estiver vazio
searchField.addEventListener('keypress', function (event) {
if (event.key === 'Enter') {
if (searchField.value.trim() === '') {
event.preventDefault();
}
// Se tiver conteúdo, deixa o submit acontecer naturalmente
}
});
// Controlar o estado do botão
searchField.addEventListener('input', function () {
if (searchBtn) {
if (searchField.value.trim() !== '') {
searchBtn.disabled = false;
} else {
searchBtn.disabled = true;
}
}
});
}
});
</script>