{% if titles is not empty %}
  <ul class="nav nav-tabs" role="tablist">
    {% for title in titles %}
      <li role="presentation"{%if loop.index == selectedtab %} class="active"{% endif %}>
        <a 
          href="#{{ slugs[loop.index0] }}" 
          role="tab" 
          data-toggle="tab" 
          onclick="window.dispatchEvent(new Event('resize'));" {# needed to refresh map for geolocalization#}
        >
          {{ title }}
        </a>
      </li>
    {% endfor %}
  </ul>

  <div class="tab-content">
{% endif %}