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

{% block head_title %}{% trans "Feed" %}: {{ feed.title }} :: {{ site.name }}{% endblock %}

{% block extra_head %}
    <meta name="title" content="{% trans 'Feed' %}: {{ feed.title }} :: {{ site.name }}" />
    <meta name="description" content="{% trans 'Feed' %} {{ feed.title }}" />
    <meta name="robots" content="noindex, follow" />
    <link rel="canonical" href="//{{ site.domain }}{{ feed.get_absolute_url }}"/>
{% endblock %}

{% block breadcrumb_section %}
    <li class="breadcrumb-item">
        <a class="text-success" href="{% url 'planet:blog-list' %}">{% trans 'Blogs' %}</a>
    </li>
    <li class="breadcrumb-item">
        <a class="text-success" href="{{ feed.blog.get_absolute_url }}">{{ feed.blog.title }}</a>
    </li>
    <li class="breadcrumb-item">
        <a class="text-success" href="{% url 'planet:feed-list' %}">{% trans 'Feeds' %}</a>
    </li>
{% endblock %}
{% block breadcrumb_detail %}
    <li class="breadcrumb-item active" aria-current="page">{{ feed.title }}</li>
{% endblock %}


{% block content %}
    <h1>{% trans "Feed" %}: {{ feed.title }}</h1>
    {% if feed.subtitle %}
        <p>{{ feed.subtitle|striptags }}</p>
    {% endif %}

    <div class="content">
        <div class="row">
            <div class="table-responsive px-0">
                <table class="table table-bordered mb-4">
                    <tr>
                        <th>{% trans 'Blog' %}</th>
                        <td><a href="{{ feed.blog.get_absolute_url }}" class="text-success text-decoration-none" title="{% trans 'See details and posts for blog' %} {{ feed.blog.title }}">{{ feed.blog.title }}</a></td>
                    </tr>
                    <tr>
                        <th>{% trans 'RSS 2.0 Feed' %}</th>
                        <td><a href="{{ feed.url }}" class="text-success text-decoration-none" title="{% trans 'Subscribe to ' %} {{ feed.title }}">{{ feed.title }}</a></td>
                    </tr>
                    <tr>
                        <th>{% trans 'web' %}</th>
                        <td><a target="_blank" href="{{ feed.blog.url }}" class="text-success text-decoration-none" title="{% trans 'Go to the original blog' %}">{{ feed.blog.url }}</a></td>
                    </tr>
                    <tr>
                        <th>{% trans 'Last Update' %}</th><td>{{ feed.last_checked|date:"m.d.Y" }}</td>
                    </tr>
                    <tr>
                        <th>{% trans 'Posts' %}</th><td>{{ feed.post_set.count }}</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>

    <div class="content">
    {% autopaginate posts 10 %}
    {% for post in posts %}
        <div class="post row">
            {% include "planet/posts/details.html" %}
        </div>
    {% endfor %}
    {% paginate %}
    </div>
{% endblock %}

{% block right_column %}
    {% recent_blogs %}
    {{ block.super }}
{% endblock %}
