{% extends "umap/content.html" %}

{% load i18n %}

{% block head_title %}
  {% translate "Explore maps" %} - {{ SITE_DESCRIPTION }}
{% endblock head_title %}

{% block messages %}
  {# We don't want maps from the results list to display errors in the main page. #}
{% endblock messages %}
{% block maincontent %}
  {% include "umap/search_bar.html" %}
  <div class="wrapper">
    <div class="row">
      {% if request.GET.q %}
        {% if maps %}
          <h2>
            {% blocktranslate trimmed count counter=count %}
              {{ count }} map found:
            {% plural %}
              {{ count }} maps found:
            {% endblocktranslate %}
          </h2>
          <div class="grid-container">
            {% include "umap/map_list.html" with prefix="search_map" %}
          </div>
        {% else %}
          <h2>
            {% trans "No map found." %}
          </h2>
        {% endif %}
      {% else %}
        <h2>
          {% if request.GET.tags %}
            {% trans "Latest created maps in category" %}
            {% for value, label in UMAP_TAGS %}
              {% if request.GET.tags == value %}
                <mark>{{ label }}</mark>:
              {% endif %}
            {% endfor %}
          {% else %}
            {% trans "Latest created maps" %}
          {% endif %}
        </h2>
        <div class="grid-container">
          {% include "umap/map_list.html" with prefix="search_map" %}
        </div>
      {% endif %}
    </div>
  </div>
{% endblock maincontent %}
