{% extends "layout.html" %}

{% block feed %}
<link href="newsletter-editions/feed" type="application/atom+xml" rel="alternate" title="Aus GLAMR Newsletters" />
{% endblock %}

{% block content %}
    {% for edition in latest %}
    <div class="card">
        <div class="card-title">
            <a href="{{ edition.url }}"><h4>{{ edition.title }}</h4></a>
            <p class="meta">
                {% if edition.author_name %}
                <span class="author_name">{{ edition.author_name }}</span> |
                {% endif %}
                <span class="blog_title">{{ edition.newsletter.name }}</span>
            </p>
        </div>
        {% if edition.description %}
        <div class="card-body">
            {% autoescape off %}
            <p>{{ edition.description|truncatewords_html:60  }}</p>
            {% endautoescape %}
        </div>
        {% endif %}
    </div>
    {% empty %}
    <p>Oh no! There are no editions available. Try checking out <a href="{% url 'blog-articles' %}">some blog posts</a>.</p>
    {% endfor %}
{% endblock %}