<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
  {# Brand and toggle get grouped for better mobile display #}
  <div class="navbar-header">
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
      <span class="sr-only">Toggle navigation</span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
    <a class="navbar-brand" href="{{ request.url_root }}"><img src="{{ url_for('abilian_static', filename='img/logo-abilian-32x32.png') }}" /></a>
  </div>

  <div class="collapse navbar-collapse navbar-ex1-collapse">
    <ul class="nav navbar-nav">
      {%- for navitem in actions.for_category('navigation:section') %}
        {%- if navitem.divider %}<li class="divider"></li>{%- endif %}
        <li>{{ navitem.render() }}</li>
      {%- endfor %}
    </ul>

    <ul id="nav-menu-user" class="nav navbar-nav navbar-right">
      {%- for action in actions.for_category('navigation:user') %}
        {%- if action.divider %}<li class="divider"></li>{%- endif %}
        <li>{{ action.render() }}</li>
      {%- endfor %}
    </ul>

    <form class="navbar-form navbar-right" role="search" method="GET" action="{{ url_for('search.search_main') }}">
      <input type="text" name="q" class="search-query form-control"
             placeholder="{{ _('Search') }}" autocomplete="off" id="search-box" />
    </form>

    {%- set admin_nav = actions.for_category('navigation:admin') %}
    {%- if admin_nav %}
      <ul id="nav-menu-admin" class="nav navbar-nav navbar-right">
        {%- for action in admin_nav %}
        <li>{{ action.render() }}</li>
      {%- endfor %}
      </ul>
    {%- endif %}

  </div> {# navbar-collapse #}
</nav>
