{% extends "zinnia/base.html" %}
{% load i18n zinnia_tags %}

{% block meta-description %}{% trans "Latest entries for" %} {% if category %}{% trans "the category" %} {{ category }}{% if category.description %}: {{ category.description|striptags|safe }}{% endif %}{% endif %}{% if tag %}{% trans "the tag" %} {{ tag }}{% endif %}{% if author %}{% trans "the author" %} {{ author }}{% endif %}{% endblock meta-description %}

{% block meta-description-page %}{% if page_obj %}{% ifnotequal page_obj.number 1 %} {% trans "page" %} {{ page_obj.number }}{% endifnotequal %}{% endif %}{% endblock meta-description-page %}

{% block link %}
  {{ block.super }}
  {% if category %}
    <link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed" %} {{ category }}" href="{% url 'zinnia:category_feed' category.tree_path %}" />
  {% endif %}
  {% if tag %}
    <link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed" %} {{ tag }}" href="{% url 'zinnia:tag_feed' tag.name %}" />
  {% endif %}
  {% if author %}
    <link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed" %} {{ author }}" href="{% url 'zinnia:author_feed' author.get_username %}" />
  {% endif %}
{% endblock link %}

{% block title %}{% if category %}{% trans "Category" %} {{ category }}{% endif %}{% if tag %}{% trans "Tag" %} {{ tag }}{% endif %}{% if author %}{% trans "Author" %} {{ author }}{% endif %}{% endblock title %}

{% block title-page %}{% if page_obj %}{% ifnotequal page_obj.number 1 %} - {% trans "Page" %} {{ page_obj.number }}{% endifnotequal %}{% endif %}{% endblock title-page %}

{% block body-class %}entry-list{% if page_obj %} paginated page-{{ page_obj.number }}{% endif %}{% if category %} category category-{{ category.slug }}{% endif %}{% if tag %} tag tag-{{ tag|slugify }}{% endif %}{% if author %} author author-{{ author|slugify }}{% endif %}{% endblock body-class %}

{% block content %}
{{ block.super }}

{% block content-title %}
{% if category %}
<h1>{% blocktrans %}Category archives: {{ category }}{% endblocktrans %}</h1>
{% if category.description %}
<p>{{ category.description|striptags|safe }}</p>
{% endif %}
{% endif %}

{% if tag %}
<h1>{% blocktrans %}Tag archives: {{ tag }}{% endblocktrans %}</h1>
{% endif %}

{% if author %}
<h1>{% blocktrans %}Author archives: {{ author }}{% endblocktrans %}</h1>
{% endif %}
{% endblock content-title %}

{% block content-loop %}
{% for object in object_list %}
  {% include object.content_template with object_content=object.html_preview continue_reading=1 %}
{% empty %}
  <p class="info">
    <a href="{% url 'admin:zinnia_entry_add' %}">{% trans "No entries yet." %}</a>
  </p>
{% endfor %}
{% endblock content-loop %}

{% block content-pagination %}
{% if is_paginated %}
  {% zinnia_pagination page_obj %}
{% endif %}
{% endblock content-pagination %}

{% block content-related %}
{% endblock content-related %}

{% endblock content %}
