{% extends "wiki/base.html" %}
{% set counter = _('Found {0} documents.')|f(count) %}
{% if category %}
  {% set title = category %}
{% elif tag %}
  {% set title = _('Articles tagged: {tag}')|f(tag=tag) %}
{% elif is_templates %}
  {% set title = _('All templates') %}
  {% set counter = _('Found {0} templates.')|f(count) %}
{% elif errors %}
  {% set title = _('Documents with errors') %}
{% elif toplevel %}
  {% set title = _('Top level documents') %}
{% elif noparent %}
  {% set title = _('Documents with no parent') %}
{% else %}
  {% set title = _('All documents') %}
{% endif %}
{% block title %}{{ page_title(title) }}{% endblock %}
{% set crumbs = [(None, title)] %}

{% block extrahead %}
  {% if category %}
      <link rel="alternate" type="application/atom+xml" title="{{title}}" 
          href="{{ url('wiki.feeds.recent_documents_category', format='atom', category=category) }}" />
  {% elif tag %}
      <link rel="alternate" type="application/atom+xml" title="{{title}}" 
          href="{{ url('wiki.feeds.recent_documents', format='atom', tag=tag) }}" />
  {% else %}
      <link rel="alternate" type="application/atom+xml" title="{{title}}" 
          href="{{ url('wiki.feeds.recent_documents', format='atom') }}" />
      {% if (request.locale != 'en-US'): %}
        {# TODO: Someday, en-US won't be special in l10n. #}
        <link rel="alternate" type="application/atom+xml" 
              title="{{_('Translation updates needed')}}" 
              href="{{ url('wiki.feeds.l10n_updates', format='atom') }}" />
      {% endif %}
  {% endif %}
{% endblock %}

{% block content %}

    <div id="document-list" class="boxed">
      <h1>{{ title }}</h1>
      {% if documents.object_list %}
        <p>{{ counter }}</p>
        <ul class="documents">
          {% for doc in documents.object_list %}
            <li>
              <a href="{{ doc.get_absolute_url() }}">{{ doc.slug }}</a>
                {% if not is_templates and not errors %}
                  <small>{{ doc.get_summary() | truncate(100) }}</small>
                {% endif %}
            </li>
          {% endfor %}
        </ul>
        {{ documents|paginator }}
      {% else %}
        <p>{{ _('There are no articles.') }}</p>
      {% endif %}
    </div>

{% endblock %}
