{% extends "django_village/footer.html" %}
{% load i18n l10n %}

{% block footer_links %}
  {{ block.super }}
  <li class="village-footer__bottom-item">
    <button id="footer__bottom-link__parametres-affichage"
            aria-controls="village-theme-modal"
            data-village-opened="false"
            class="village-icon-theme-fill village-link--icon-left village-footer__bottom-link"
            data-village-js-modal-button="true">
      {% translate "Display settings" %}
    </button>
  </li>
{% endblock footer_links %}

{% block footer_brand %}
  {% translate "Back to home page" as back_to_home_label %}
  {% url 'index' as home_url %}
  {% if SITE_CONFIG.operator_logo_file and SITE_CONFIG.operator_logo_alt %}
    <div class="village-footer__brand village-enlarge-link">
      <p class="village-logo"
         title="{{ SITE_CONFIG.footer_brand|default:'village' }}">
        {{ SITE_CONFIG.footer_brand_html| default_if_none:'république<br />française' | safe }}
      </p>
      <a class="village-footer__brand-link"
         href="{{ home_url }}"
         title="{{ back_to_home_label }} - {{ SITE_CONFIG.operator_logo_alt }} - {{ SITE_CONFIG.footer_brand|default:'village' }}">
        <img class="village-footer__logo"
             src="{{ SITE_CONFIG.operator_logo_file.url }}"
             alt="{{ SITE_CONFIG.operator_logo_alt }}"
             {% if SITE_CONFIG.operator_logo_width >= 1 %}style="max-width:{{ SITE_CONFIG.operator_logo_width|unlocalize }}rem;"{% endif %} />
        {# L’alternative de l’image (attribut alt) doit impérativement être renseignée et reprendre le texte visible dans l’image #}
      </a>
    </div>
  {% else %}
    <div class="village-footer__brand village-enlarge-link">
      <a id="footer-operator"
         href="{{ home_url }}"
         title="{{ back_to_home_label }} - {{ SITE_CONFIG.site_title }} - {{ SITE_CONFIG.footer_brand|default:'village' }}">
        {% block brand %}
          <p class="village-logo">
            {{ SITE_CONFIG.footer_brand_html| default_if_none:'république<br />française' | safe }}
          </p>
        {% endblock brand %}
      </a>
    </div>
  {% endif %}
{% endblock footer_brand %}
