<nav class="navbar navbar-default navbar-static-top MetaBrainz" role="navigation">
  <div class="container">

    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#mb-navbar-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 logo" href="{{ url_for('index.home') }}">
        <img src="{{ url_for('static', filename='img/navbar_logo.svg') }}" alt="MetaBrainz Foundation" />
      </a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="mb-navbar-collapse">
      <ul class="nav navbar-nav">
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ _('About ') }}<span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="{{ url_for('index.about') }}">{{ _('The Foundation') }}</a></li>
            <li><a href="{{ url_for('index.projects') }}">{{ _('Projects') }}</a></li>
            <li><a href="{{ url_for('index.datasets') }}">{{ _('Datasets') }}</a></li>
            <li><a href="{{ url_for('index.team') }}">{{ _('Team') }}</a></li>
            <li><a href="{{ url_for('index.shop') }}">{{ _('Shop') }}</a></li>
          </ul>
        </li>

        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ _('Policies ') }}<span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="{{ url_for('index.social_contract') }}">{{ _('Social Contract') }}</a></li>
            <li><a href="{{ url_for('index.code_of_conduct') }}">{{ _('Code of Conduct') }}</a></li>
            <li><a href="{{ url_for('index.privacy_policy') }}">{{ _('Privacy Policy') }}</a></li>
            <li><a href="{{ url_for('index.conflict_policy') }}">{{ _('Conflict Resolution Policy') }}</a></li>
            <li><a href="{{ url_for('index.gdpr_statement') }}">{{ _('GDPR Compliance') }}</a></li>
          </ul>
        </li>

        <li><a href="{{ url_for('supporters.supporters_list') }}">{{ _('Supporters') }}</a></li>
        <li><a href="{{ url_for('index.sponsors') }}">{{ _('Sponsors') }}</a></li>
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ _('Reports ') }}<span class="caret"></span></a>
          <ul class="dropdown-menu" role="menu">
            <li><a href="{{ url_for('annual_reports.index') }}">{{ _('Archived Annual Reports') }}</a></li>
            <li><a href="{{ url_for('financial_reports.index') }}">{{ _('Financial Reports') }}</a></li>
            <li><a href="{{ url_for('payments.donors') }}">{{ _('Donors') }}</a></li>
          </ul>
        </li>
        <li><a href="{{ url_for('payments.donate') }}">{{ _('Donate') }}</a></li>
      </ul>

      {# Not showing supporter stuff on error pages. If attempt to load supporter info fails there, page will not render. #}
      {% if not error %}
        <ul class="nav navbar-nav navbar-right">
          {% if not current_user or current_user.is_anonymous %}
            <li class="support-link"><a href="{{ url_for('supporters.account_type') }}">{{ _('Register') }}</a></li>
            <li><a href="{{ url_for('supporters.login') }}">{{ _('Sign in') }}</a></li>
          {% else %}
            <li class="dropdown">
              <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                {{ current_user.musicbrainz_id }} <span class="caret"></span>
              </a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="{{ url_for('supporters.profile', musicbrainz_id=current_user.musicbrainz_id) }}">{{ _('Your profile') }}</a></li>
                <li><a href="https://musicbrainz.org/new-oauth2/client/list">{{ _('OAuth applications') }}</a></li>
                <li><a href="{{ url_for('supporters.logout') }}">{{ _('Sign out') }}</a></li>
              </ul>
            </li>
          {% endif %}
        </ul>
      {%- endif -%}
    </div>

  </div>
</nav>
