<div id="header">
{% if editmode %}
{# {% spaceless %} #}
{# add global stylesheets and scripts outside of any blocsk to add them to the helpers before any others assets are added #}
{# we use the view helper to have cache buster functionality #}
{% do pimcore_head_link().appendStylesheet(asset('static/css/index.css')) %}
{% do pimcore_head_script().appendFile(asset('static/js/index.js')) %}
{# {% endspaceless %} #}
{% block head_stylesheets deferred %}
{{ pimcore_head_link() }}
{% endblock %}
{% block scripts deferred %}
{{ pimcore_head_script() }}
{% endblock %}
{% endif %}
{# get root node if there is no document defined (for pages which are routed directly through static route) #}
{% if not document is defined or not document %}
{% set document = pimcore_document(1) %}
{% endif %}
{# get the document which should be used to start in navigation | default home #}
{% set navStartNode = document.getProperty('navigationRoot') %}
{% if not navStartNode is instanceof('\\Pimcore\\Model\\Document\\Page') %}
{% set navStartNode = pimcore_document_by_path('/' ~ app.request.getLocale()) %}
{% endif %}
{% set mainNavigation = pimcore_build_nav({
active: document,
root: navStartNode
}) %}
<header>
{# ............................................................................................. #}
{% if realDocument is defined %}
{% set doc = realDocument %}
{% else %}
{% set doc = document %}
{% endif %}
{# ............................................................................................. #}
<nav class="navbar navbar-expand-lg navbar-light">
<div class="container navbar-special-class">
<a class="navbar-brand" href="/{{ app.request.getLocale() }}">
{% if not pimcore_image('logo_header').isEmpty() and not editmode %}
{{ pimcore_image('logo_header').getThumbnail('logo_header').getHtml({class: 'img-fluid'}) | raw }}
{% else %}
{{ pimcore_image('logo_header') }}
{% endif %}
</a>
<div class="navbar-buttons">
<button type="button" class="search-button search-button--mobile">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="5.5" cy="5.5" r="4.5" stroke="white" stroke-width="2"/>
<rect x="9.41406" y="8" width="8" height="2" rx="1" transform="rotate(45 9.41406 8)" fill="white"/>
</svg>
</button>
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<form action="/{{ app.request.getLocale() }}/search" method="get" class="search-form search-form--mobile">
<input type="text" class="search-input" name="term" placeholder="{{ 'Pretraži' | trans }}">
<div class="search-close"></div>
</form>
<div class="collapse navbar-collapse align-items-center justify-content-end" id="navbarNav">
<ul class="navbar-nav align-items-center justify-content-end position-relative">
<li class="nav-item btn-download-header-wrapper--mobile">
<div class="h5 text-uppercase">{{ 'DOWNLOAD' | trans }}</div>
<div class="app-buttons">
{% include 'components/google-play-button.html.twig' %}
{% include 'components/app-store-button.html.twig' %}
</div>
</li>
{% for nav in mainNavigation %}
{% if nav._visible %}
<li class="nav-item">
<a class="nav-link {{ nav.class }}
{{ nav.label == 'blog-posts' and blogPostId is defined and blogPostId is not empty ? 'active' }}"
href="{{ nav.uri }}">
<span class="h5">
{{ nav.title }}
</span>
</a>
</li>
{% endif %}
{% endfor %}
<li>
<button type="button" class="search-button search-button--desktop">
<svg width="18" height="18" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="5.5" cy="5.5" r="4.5" stroke="white" stroke-width="2"/>
<rect x="9.41406" y="8" width="8" height="2" rx="1" transform="rotate(45 9.41406 8)" fill="white"/>
</svg>
</button>
</li>
<li class="nav-item nav-item-language--mobile">
{% if blogPostId is defined %}
{% for key,link in get_localized_links(doc, blogPostId) %}
<a href="{{ link.link }}" class="nav-link {{ app.request.getLocale == key ? 'text-main-green'}}">
{{ link.text }}
</a>
{% endfor %}
{% else %}
{% for key,link in get_localized_links(doc) %}
<a href="{{ link.link }}" class="nav-link {{ app.request.getLocale == key ? 'text-main-green'}}">
{{ link.text }}
</a>
{% endfor %}
{% endif %}
</li>
<li class="nav-item mt-auto d-block d-lg-none">
<p class="h6 navbar-bottom-text text-light-purple">
{{ '©Copyright Meddox' | trans }} <script>document.write(new Date().getFullYear())</script>
<br>
{% if not editmode %}
{% for i in pimcore_iterate_block(pimcore_block("meddoxHeaderLinks", {class: 'd-flex'})) %}
{{ pimcore_link('mobile-menu-link-' ~ i, {class: 'text-light-purple mr-1'}) }}
{% endfor %}
{% endif %}
<a href="mailto:{{ pimcore_input('mail_to_header').getData() }}" class="text-light-purple">
{{ pimcore_input('mail_to_header').getData() }}
</a>
</p>
</li>
<li>
<form action="/{{ app.request.getLocale() }}/search" method="get" class="search-form search-form--desktop">
<input type="text" class="search-input" name="term" placeholder="{{ 'Pretraži' | trans }}">
<div class="search-close"></div>
</form>
</li>
</ul>
<ul class="navbar-nav navbar-nav--desktop align-items-center justify-content-end">
<li class="nav-item btn-download-header-wrapper">
<span class="nav-link dropdown nav-dropdown">
<div class="btn btn-primary dropdown-toggle" role="button" id="dropdownMenu" data-toggle="dropdown" aria-expanded="false">{{ 'DOWNLOAD' | trans }}</div>
<div class="dropdown-menu" aria-labelledby="dropdownMenu">
<div class="dropdown-item">
<a href="{{ pimcore_website_config('GooglePlayDownloadLink') }}" target="_blank" title="{{ 'Google Play' | trans }}" class="h5">{{ 'Google Play' | trans }}</a>
</div>
<div class="dropdown-item">
<a href="{{ pimcore_website_config('AppStoreDownloadLink') }}" target="_blank" title="{{ 'App Store' | trans }}" class="h5">{{ 'App Store' | trans }}</a>
</div>
</div>
</span>
</li>
<li class="nav-item nav-item-language nav-item-language-init">
<a href="javascript:;" class="nav-link language-switcher-wrapper">
<select name="language-select" id="language-select">
{% if blogPostId is defined %}
{% for key,link in get_localized_links(doc, blogPostId) %}
<option value="{{ key }}" data-link="{{ link.link }}" {{ app.request.getLocale == key ? 'selected'}}>
{{ link.text }}
</option>
{% endfor %}
{% else %}
{% for key,link in get_localized_links(doc) %}
<option value="{{ key }}" data-link="{{ link.link }}" {{ app.request.getLocale == key ? 'selected'}}>
{{ link.text }}
</option>
{% endfor %}
{% endif %}
</select>
</a>
</li>
</ul>
</div>
</div>
{% for type, message in app.session.flashbag.all() %}
{% include 'components/alerts-modals/message-bar.html.twig' with {
type: type,
message: message,
dismissible: true
} %}
{% endfor %}
</nav>
</header>
{% if editmode %}
<div class="row">
<div class="col-lg-2">
<div class="mt-3 p-2 rounded font-weight-light d-flex flex-column ml-4 bg-light-purple">
<span class="font-italic mb-2 text-white">{{ 'Mail to in mobile menu' | trans }}</span>
{{ pimcore_input('mail_to_header', {placeholder: 'Mail to...', 'width': 180, 'class' : 'text-white'}) }}
</div>
</div>
<div class="col-lg-6">
{% for i in pimcore_iterate_block(pimcore_block("meddoxHeaderLinks", {class: 'd-flex'})) %}
{{ pimcore_link('mobile-menu-link-' ~ i) }}
{% endfor %}
</div>
</div>
{% endif %}
</div>