{% extends "directories/base.html" %}
{% load pagination_tags %}
{% load directory_tags %}
{% load base_tags %}
{% load search_tags %}
{% load i18n %}

{% block title %}{% firstof MODULE_DIRECTORIES_LABEL_PLURAL trans 'Directories' %} {% trans "List" %} {{ block.super }}{% endblock %}
{% block meta_description %}{{ block.super }}{% endblock %}
{% block meta_keywords %}{{ block.super }}{% endblock %}

{% block extra_head %}
{{ block.super }}
<link rel="stylesheet" href="{{ STATIC_URL }}css/directories.css">
<link rel="alternate" type="application/rss+xml" title="{% trans 'Latest' %}  {% firstof MODULE_DIRECTORIES_LABEL_PLURAL trans 'Directories' %}" href="{% url directory.feed %}" />
{% endblock %}

{% block body %}
<div class="t">
{% directory_nav request.user %}
    <h1>{% firstof SITE_GLOBAL_SITEPRIMARYKEYWORDS SITE_GLOBAL_SITEDISPLAYNAME %} {% firstof MODULE_DIRECTORIES_LABEL_PLURAL trans 'Directories' %}</h1>

    {% autopaginate directories 10 %}
    {% directory_search %}
    <span><em>{{ paginator.count }} {% firstof MODULE_DIRECTORIES_LABEL_PLURAL trans 'Directories' %} {% trans "Found" %}</em></span>
    
    <div class="directories-wrap">
    {% for directory in directories %}
        {% search_result directory %}
    {% empty %}
        {% if user.profile.is_superuser %}
        <p><a href="{% url directory.add %}">{% trans "Add a new" %} {% firstof MODULE_DIRECTORIES_LABEL 'Directory' %}</a></p>
        {% endif %}
    {% endfor %}
    </div>

    {% paginate %}
</div>
{% endblock %}
