{% extends "planet/base.html" %}
{% load i18n pagination_tags tagging_tags planet_tags %}

{% block head_title %}{{ author.name }} {% trans 'has written the following posts' %}{% endblock %}

{% block extra_head %}
    <meta name="title" content="{{ author.name }} {% trans 'has written the following posts' %} - {{ site.name }}" />
    <meta name="description" content="{{ author.name }} {% trans 'has written the following posts' %} - {{ site.name }}" />
    <meta name="robots" content="index, follow" />
    <link rel="canonical" href="http://{{ site.domain }}{{ author.get_absolute_url }}"/>
{% endblock %}

{% block breadcrumb_section %}
    <li><a href="{% url 'planet.views.authors_list' %}">Authors</a> <span class="divider">/</span></li>
    {% if tag %}
        <li><a href="{{ author.get_absolute_url }}">{{ author.name }}</a> <span class="divider">/</span></li>
    {% endif %}
{% endblock %}
{% block breadcrumb_detail %}
    {% if tag %}
        <li class="active">Tag: {{ tag.name }}</li>
    {% else %}
        <li class="active">{{ author.name }}</li>
        {% endif %}
{% endblock %}

{% block head_feeds %}
    <link rel="alternate" type="application/rss+xml" title="{% trans 'blog' %} {{ author.name }} {% trans 'in' %} {{ site.name }} - RSS 2.0 Feed" href="{% url 'planet_author_rss_feed' author.pk %}" />
{% endblock %}

{% block rss_feed %}
    <a href="{% url 'planet_author_rss_feed' author.pk %}" title="{% trans 'Suscribe to RSS feed for blog' %} {{ author.name }}">
        <img src="{{ MEDIA_URL }}images/rss20.png" alt="RSS 2.0 Feed"/>
    </a>
{% endblock %}

{% block content %}
    <h1>{{ author.name }} {% trans "has written the following posts" %}:</h1>

    {% if tag %}
        <div>
            <p>{% trans 'Posts under tag' %}: <strong>{{ tag }}</strong></p>
            <a href="{{ author.get_absolute_url }}" title="{% trans 'See all posts by' %} {{ author.name }}">
                {% trans 'See the complete list of posts by this author' %}
            </a>
        </div>
    {% endif %}

    {% autopaginate posts 20 %}
    {% for post in posts %}
        <div class="post {% cycle 'even' 'odd' %} clearfix">
            {% post_details post %}
        </div>
    {% endfor %}
    {% paginate %}
{% endblock %}

{% block right_column %}
    {% if tag %}
        <div>
            {% related_tags_for tag %}
        </div>
        <div>
            {% authors_about tag %}
        </div>
    {% endif %}

    {% cloud_for_author author %}

    {% if tag %}
        <li>
            <a href="{% url 'planet_tag_author_list' tag.name %}" title="{% trans 'See the list of authors talking about this tag' %}">
                {% trans 'People talking about this' %}
            </a>
        </li>
        <li>
            <a href="{% url 'planet_tag_feed_list' tag.name %}" title="{% trans 'See the list of blogs talking about this tag' %}">
                {% trans 'Feeds talking about this' %}
            </a>
        </li>
    {% endif %}
{% endblock %}
