<!-- header -->

<!-- embed -->
<div class="temp-embed"></div>

<!-- large header bg image -->
<div class="bgimage"></div>

<!-- wrapper & responsive navigation -->
<div class="wrapper clearfix">
  <div class="main-navigation-inner clearfix inner">

    {% set home_link = home_link|default('/') -%}
    <!-- logo -->
    <div class="medium-8 small-12 columns">
      <div class="logo-block">
        <a href="{{ home_link }}">
          {% set active_title= active_title|default('Erfgoedstijl') -%}
          <div class="logo-block-title"><h1>{{active_title}}</h1></div>
          <img src="{{ request.static_path(app_package + ':static/img/pyoes/OE-vlaanderen-logo.png') }}" width="65">
          <h2>Vlaanderen</h2>
          <h4>is erfgoed</h4>
        </a>
      </div>
    </div>
    <div class="medium-4 columns text-right header-links show-for-medium-up">
      <nav>
        <ul>
          <li><a href="https://www.onroerenderfgoed.be/contact" target="_blank" title="Contacteer ons">Contact</a></li>
          <li><a href="https://www.onroerenderfgoed.be/over-ons" target="_blank" title="Meer informatie over ons">Over ons</a></li>
        </ul>
      </nav>
    </div>

  </div>
</div>

<!-- navigation -->
{% block main_nav %}
  <nav class="top-bar" data-topbar role="navigation">
    <ul class="title-area">
      <li class="name">
      </li>
      <li class="toggle-topbar menu-icon"><a href="#"><span>menu</span></a></li>
    </ul>
    <section class="top-bar-section inner-nav">
      {% set active_main_nav = active_main_nav|default('home') -%}
      {% set default_main_nav = [
        ('home', 'Home', '/'), 
        ('zoeken', 'Zoeken', '/'),
        ('vinden', 'Vinden', '/')
        ]
        -%}
      {% set default_dropdown_main_nav = [] %}

      {% set default_login_nav = [('Aanmelden', '/')] %}
      {% set default_login_sub_nav = [('Profiel', '/'), ('Afmelden', '/')] %}

      {% set main_nav = main_nav|default(default_main_nav) -%}

      {# MAIN NAV #}
      <ul class="left">
        {% for id, caption, href in main_nav %}
          <li{% if id == active_main_nav %} class="active"{% endif %}>
            {% if id == 'home' %}
              <a href="{{ href }}"><i class="fa fa-home"></i></a>
            {% else %}
              <a href="{{ href }}">{{ caption }}</a>
            {% endif %}
          </li>
        {% endfor %}
        <li class="show-for-small-only"><a href="https://www.onroerenderfgoed.be/contact" target="_blank" title="Contacteer ons">Contact</a></li>
        <li class="show-for-small-only"><a href="https://www.onroerenderfgoed.be/over-ons" target="_blank" title="Meer informatie over ons">Over ons</a></li>
      </ul>

      {% set dropdown_main_nav = dropdown_main_nav|default(default_dropdown_main_nav) -%}

      {# DROPDOWN NAV #}
      {% if dropdown_main_nav|length > 0 %}
        <ul class="left">
          {% for id, caption, submenu in dropdown_main_nav %}
            <li class="has-dropdown">
              <a href="#">{{ caption }}</a>
              <ul class="dropdown">
                {% for id, subCaption, href in submenu %}
                  <li><a href="{{ href }}">{{ subCaption }}</a></li>
                {% endfor %}
              </ul>
            </li>
          {% endfor %}
        </ul>
      {% endif %}

      {% set login_nav = login_nav|default(default_login_nav) -%}
      {% set login_sub_nav = login_sub_nav|default(default_login_sub_nav) -%}

      {# USER MENU #}
      {% if login_nav|length > 0 %}
        {% if not request.user %}
          <ul class="right">
            {% if request.authenticated_userid != None %}
              <li class="has-dropdown">
              <a href="#">{{ request.authenticated_userid }}</a>
              <ul class="dropdown">
            {% endif %}
            {% for caption, href in login_nav %}
              <li><a href="{{ href }}">{{ caption }}</a></li>
            {% endfor %}
            {% if request.authenticated_userid != None %}
              </ul></li>
            {% endif %}
          </ul>
        {% else %}
          <ul class="right">
            <li class="has-dropdown">
              {% if request.user.actor and request.user.actor.omschrijving %}
                <a href="#">{{ request.user.actor.omschrijving }}</a>
              {% else %}
                {% if request.user.attributes.displayname is iterable %}
                  <a href="#">{{ request.user.attributes.displayname[0] }}</a>
                {% else %}
                  <a href="#">{{ request.user.attributes.displayname }}</a>
                {% endif %}
              {% endif %}
              <ul class="dropdown">
                {% for caption, href in login_sub_nav %}
                  <li><a href="{{ href }}">{{ caption }}</a></li>
                {% endfor %}
              </ul>
            </li>
          </ul>
        {% endif %}
      {% endif %}

    </section>
  </nav>
{% endblock %}

<!-- end header -->


