{% set dataset_type = h.default_package_type() %}
{% set org_type = h.default_group_type('organization') %}
{% set group_type = h.default_group_type('group') %}
{% import 'macros/nav_link.html' as nav %}
<footer>
  <div class="site-footer">
    <div class="container">
      {% block footer_content %}
        <div class="row">
          <div class="col-md-6">
            <p class="footer-description col-md-8">
              <img class="ckan-footer-logo" src="/base/images/ckan-logo-white.png" alt="{{ _('CKAN logo') }}">
              {{ _('The open-source data management system that powers data portals worldwide.') }}
            </p>
          </div>
          <div class="col-md-6 footer-links row">
            {% block footer_nav %}
              <ul class="list-unstyled col-md-6">
                {% block footer_links %}
                  {{ nav.link(h.url_for('home.index'), _('Home')) }}
                  {{ nav.link(h.url_for(dataset_type ~ '.search'), h.humanize_entity_type('package', dataset_type, 'footer nav') or _('Datasets'), active_blueprints=[dataset_type, dataset_type + '_resource']) }}
                  {{ nav.link(h.url_for(org_type ~ '.index'), h.humanize_entity_type('organization', org_type, 'footer nav') or _('Organizations'), active_blueprints=[org_type]) }}
                  {{ nav.link(h.url_for(group_type ~ '.index'), h.humanize_entity_type('group', group_type, 'footer nav') or _('Groups'), active_blueprints=[group_type]) }}
                  {{ nav.link(h.url_for('home.about'), _('About')) }}
                {% endblock %}
              </ul>
              <ul class="list-unstyled col-md-6">
                {% block footer_links_ckan %}
                  {% set api_url = 'https://docs.ckan.org/en/{0}/api/'.format(g.ckan_doc_version) %}
                  <li><a target="_blank" rel="noopener noreferrer" href="{{ api_url }}">{{ _('CKAN API') }}</a></li>
                  <li><a target="_blank" rel="noopener noreferrer" href="https://www.ckan.org">{{ _('CKAN Association') }}</a></li>
                  <li><a target="_blank" rel="noopener noreferrer" href="https://www.opendefinition.org/od/" class="open-data">{% trans %}<span class="prefix">Open</span><span class="suffix">Data</span>{% endtrans %}</a></li>
                {% endblock %}
              </ul>
            {% endblock %}
          </div>
        </div>
      {% endblock %}
    </div>
  </div>
  <div class="bg-black">
    <div class="container">
      <div class="row">
        <div class="col-md-9 attribution">
          {% block footer_attribution %}
            <p>{% trans %}<strong>Powered by <a target="_blank" rel="noopener noreferrer" href="http://ckan.org">CKAN</a></strong>{% endtrans %}</p>
          {% endblock %}
        </div>
        <div class="col-md-3">
          {% block footer_lang %}
            {% snippet "snippets/language_selector.html" %}
          {% endblock %}
        </div>
      </div>
    </div>
  </div>
</footer>
