{% comment %}
Displays the tabs to different event_list pages.
Used by the event_list_tabs() template inclusion tag.
{% endcomment %}

{% load spectator_core %}

<ul class="nav nav-tabs mb-4">

  {% if counts.all > 0 %}
    <li class="nav-item">
      <{% if not current_kind and page_number == 1 %}span{% else %}a href="{% url 'spectator:events:home' %}"{% endif %} class="nav-link{% if not current_kind %} active{% endif %}">All <small>({{ counts.all }})</small>{% if not current_kind and page_number == 1 %}</span>{% else %}</a>{% endif %}
    </li>
  {% endif %}

  {% for kind in event_kinds %}
    {% if counts|get_item:kind > 0 %}
      <li class="nav-item">
        {% with event_kinds_data|get_item:kind as kind_data %}
          <{% if current_kind == kind and page_number == 1 %}span{% else %}a href="{% url 'spectator:events:event_list' kind_slug=kind_data|get_item:'slug' %}"{% endif %} class="nav-link{% if current_kind == kind %} active{% endif %}">{{ kind_data|get_item:'name_plural' }} <small>({{ counts|get_item:kind }})</small>{% if current_kind == kind and page_number == 1 %}</span>{% else %}</a>{% endif %}
        {% endwith %}
      </li>
    {% endif %}
  {% endfor %}

</ul>
