{% from 'macros.html' import print_message, display_form_errors %}

<!DOCTYPE html>
<html lang="en">

  <head>
    {% block head %}
      <meta charset="utf-8">
      <title>{% block title %}MetaBrainz Foundation{% endblock %}</title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge" />
      <meta name="viewport" content="width=device-width, initial-scale=1" />

      <link rel="icon" sizes="16x16" href="{{ url_for('static', filename='img/favicon-16.png') }}" type="image/png" />
      <link rel="icon" sizes="32x32" href="{{ url_for('static', filename='img/favicon-32.png') }}" type="image/png" />
      <link rel="icon" sizes="64x64" href="{{ url_for('static', filename='img/favicon-64.png') }}" type="image/png" />
      <link rel="icon" sizes="128x128" href="{{ url_for('static', filename='img/favicon-128.png') }}" type="image/png" />
      <link rel="icon" sizes="256x256" href="{{ url_for('static', filename='img/favicon-256.png') }}" type="image/png" />

      {# The css file has a .less extension in the manifest file entry (due to its original name in Webpack entry) #}
      <link href="{{ get_static_path('main.less') }}" rel="stylesheet" media="screen" />
    {% endblock %}
  </head>

  <body>
    {% include 'navbar.html' %}

    <div class="container">
      
      {% with messages = get_flashed_messages(with_categories=true) %}
        {% for category, message in messages %}
          {{ print_message(message, category) }}
        {% endfor %}
      {% endwith %}

      {% block content %}
        <!-- Page content -->
      {% endblock %}

      {% block footer %}
        <hr />
        <div class="footer">
          <div class="row">
            <div class="col-sm-2">
              <div class="title"><a href="{{ url_for('index.about') }}">{{ _('Foundation') }}</a></div>
              <ul>
                <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>
            </div>
            <div class="col-sm-2">
              <div class="title"><a href="{{ url_for('index.about') }}">{{ _('Policies') }}</a></div>
              <ul>
                <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>
              </ul>
            </div>
            <div class="col-sm-2">
              <div class="title"><a href="{{ url_for('financial_reports.index') }}">{{ _('Finances') }}</a></div>
              <ul>
                <li><a href="{{ url_for('annual_reports.index') }}">{{ _('Archived Annual Reports') }}</a></li>
                <li><a href="{{ url_for('payments.donors') }}">{{ _('Donors') }}</a></li>
                <li><a href="{{ url_for('index.sponsors') }}">{{ _('Sponsors') }}</a></li>
                <li><a href="{{ url_for('supporters.supporters_list') }}">{{ _('Supporters') }}</a></li>
              </ul>
            </div>
            <div class="col-sm-2">
              <div class="title"><a href="{{ url_for('supporters.supporters_list') }}">{{ _('Supporters') }}</a></div>
              <ul>
                {% if not current_user or current_user.is_anonymous %}
                  <li><a href="{{ url_for('supporters.login') }}">{{ _('Sign in') }}</a></li>
                {% else %}
                  <li><a href="{{ url_for('supporters.logout') }}">{{ _('Sign out') }}</a></li>
                {% endif %}
                <li><a href="{{ url_for('supporters.profile') }}">{{ _('Access your account') }}</a></li>
                <li><a href="{{ url_for('api_index.info') }}">{{ _('API') }}</a></li>
              </ul>
            </div>
            {# Last block should fill up the rest of this row. #}
            <div class="col-sm-4">
              <div class="title"><a href="{{ url_for('index.contact') }}">{{ _('Contact us') }}</a></div>
              <ul>
                <li><a href="https://blog.metabrainz.org/category/metabrainz/">{{ _('Blog') }}</a></li>
                <li><a href="https://musicbrainz.org/doc/Communication/ChatBrainz">{{ _('Chat') }}</a></li>
                <li><a href="https://twitter.com/MetaBrainz">{{ _('Twitter/X') }}</a></li>
                <li><a href="https://mastodon.social/@metabrainz">{{ _('Mastodon') }}</a></li>
                <li><a href="https://bsky.app/profile/metabrainz.org">{{ _('Bluesky') }}</a></li>
                <li><a href="https://www.instagram.com/MetaBrainz/">{{ _('Instagram') }}</a></li>
              </ul>
            </div>
          </div>
          <div class="lower-footer">
            {{ _('Sponsored by <a href="%(google_url)s">Google</a> and
            <a href="%(sponsors_url)s">others&hellip;</a>',
            sponsors_url=url_for('index.sponsors'),
            google_url='https://www.google.com/') }}
          </div>
        </div>
      {% endblock %}

    </div>

    {% block scripts %}
      <script src="{{ url_for('static', filename='js/lib/jquery-2.1.1.min.js') }}"></script>
      <script src="{{ url_for('static', filename='js/lib/bootstrap.min.js') }}"></script>
    {% endblock %}

  </body>

</html>
