{% load i18n %}
{% load base_tags %}
{% load taggit_extras %}
<nav class="filter">
  <h2><a href="#" class="toggle toggle-nav"><i class="icon-chevron-right"></i>{% trans "Categories" %}</a></h2>
  <ul class="nav hide" id="categories">
    <li><a data-class="all" class="active trigger-query">{% trans "All Categories" %}</a></li>
    {% if HAYSTACK_SEARCH %}
        {% for category, count in categories.items %}
            <li><a data-class="{{category.identifier}}" class="trigger-query">{{ category.gn_description }}
            <span class="badge pull-right">{{ count }}</span>
            </a></li>
        {% endfor %}
    {%  else %}
        {% categories as category_list %}
        {% for category in category_list %}
            {% if category.is_choice %}
            <li><a data-class="{{category.identifier}}" class="trigger-query">{{ category.gn_description }}
            {% if type == 'layer' %}
            <span class="badge pull-right">{{ category.layer_count }}</span>
            {% elif type == 'map' %}
            <span class="badge pull-right">{{ category.map_count }}</span>
            {% elif type == 'document' %}
            <span class="badge pull-right">{{ category.document_count }}</span>
            {% else %}
            <span class="badge pull-right">{{ category.layer_count|add:category.map_count|add:category.document_count }}</span>
            {% endif %}
            </a></li>
            {% endif %}
        {% endfor %}
    {%  endif %}
  </ul>
</nav>
<nav class="filter">
  <h2><a href="#" class="toggle toggle-nav"><i class="icon-chevron-right"></i>{% trans "Date" %}</a></h2>
  <ul class="nav hide" id="date_start">
    <label>Date begins after:</label>
    <li><input value="yyyy-mm-dd" data-date-format="yyyy-mm-dd" type="text" class="datepicker" placeholder="yyyy-mm-dd" /></li>
  </ul>
  <ul class="nav hide" id="date_end">
    <label>Date ends before:</label>
    <li><input value="yyyy-mm-dd" data-date-format="yyyy-mm-dd" type="text" class="datepicker" placeholder="yyyy-mm-dd" /></li>
  </ul>
</nav>
<nav class="filter">
  <h2><a href="#" class="toggle toggle-nav"><i class="icon-chevron-right"></i> {% trans "Keywords" %}</a></h2>
  <ul class="nav hide" id="keywords">
    {% for tag in tags.values %}
      <li><a data-class="{{ tag.slug }}" class="trigger-query">{{ tag.name }} <span class="badge pull-right">{{ tag.count }}</span></a></li>
    {% endfor %}
  </ul>
</nav>
