{% extends "articles/base.html" %}
{% load pagination_tags %}
{% load article_tags %}
{% load base_tags %}
{% load search_tags %}
{% load i18n %}

{% block title %}{% firstof MODULE_ARTICLES_LABEL_PLURAL 'Articles' %} {% 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/articles.css">
<link rel="alternate" type="application/rss+xml" title="{% trans "Latest" %} {% firstof MODULE_ARTICLES_LABEL_PLURAL 'Articles' %}" href="{% url article.feed %}" />
{% endblock %}

{% block body %}
<div class="t">
    {% article_nav request.user %}
    <h1>{% firstof SITE_GLOBAL_SITEPRIMARYKEYWORDS SITE_GLOBAL_SITEDISPLAYNAME %} {% firstof MODULE_ARTICLES_LABEL_PLURAL 'Articles' %}</h1>

    {% autopaginate articles 10 %}
    {% article_search %}
    <span><em>{{ paginator.count }} {% firstof MODULE_ARTICLES_LABEL_PLURAL 'Article Search' %} {% trans "Found" %}</em></span>
    
    <div class="articles-wrap">
    {% for article in articles %}
        {% search_result article %}
    {% empty %}
        {% if user.profile.is_superuser %}
        <p><a href="{% url article.add %}">{% trans "Add a new" %} {% firstof MODULE_ARTICLES_LABEL 'Article' %}</a></p>
        {% endif %}
    {% endfor %}
    </div>

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