<nav class="navbar navbar-default">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">{{'{{'}}_('Toggle navigation'){{'}}'}}</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        {% if request.c2cgeoform_application %}
        {% for table in request.c2cgeoform_application.tables() %}
        <li role="presentation" class="{{'active' if request.matchdict and request.matchdict.get('table') == table['key'] else ''}}">
          <a href="{{request.route_url('c2cgeoform_index', table=table['key'])}}">{{request.localizer.translate(table['plural'])}}</a>
        </li>
        {% endfor %}
        {% endif %}
      </ul>

      <ul class="nav navbar-nav navbar-right">
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ request.locale_name }} <span class="caret"></span></a>
          <ul class="dropdown-menu">
            {% for locale in request.registry.settings['pyramid.available_languages'].split(' ') %}
            <li><a href="{{request.route_url('c2cgeoform_locale', _query=(('language', locale),))}}">{{locale}}</a></li>
            {% endfor %}
          </ul>
        </li>
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
