{% load i18n %}
{% load sekizai_tags %}
{% load goscale_tags %}

{% goscale_addtoblock "css" %}
	<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}goscale/css/goscale.plugins.feeds.css" />
{% endaddtoblock %}

{% goscale_addtoblock "js" %}
	<script type="text/javascript" src="{{ STATIC_URL }}goscale/js/goscale.plugins.feeds.js" data-callback="plugins.goscalePluginsFeeds"></script>
{% endaddtoblock %}

{% block posts_content %}
    {% if post %}
        {% include "post.html" %}
    {% else %}
		{% if posts %}
			<div class="goscale-plugins-feeds">
				{% if title %}<h1>{{ title }}</h1>{% endif %}
				
				{% if posts %}
					<dl class="ContentList">
						{% for post in posts %}
							{% if post.title %}
							<dt>
								<span>
									{% if external_links %}
										<a href="{{ post.link }}" target="_blank">{{ post.title }}</a>
									{% else %}
										<a href="{{ request.path }}{% goscale_plugin_post post %}">{{ post.title }}</a>
									{% endif %}
								</span>
								{% if show_date %}
									<div class="EntryDate">{{ post.published|timesince }} {% trans "ago" %}</div>
								{% endif %}
							</dt>
							{% endif %}
							<dd>
								<div class="ContentListDescription">
									{{ post.description|safe }}
								</div>
							</dd>
						{% endfor %}
						
						{% goscale_paginator %}
					</dl>
				{% endif %}
			</div>
		{% endif %}
    {% endif %}
{% endblock %}