{% extends 'base.html' %}
{% load url from future %}

{% block contents %}
<h1>Entry list</h1>

<section id="entry-list">
    {% for object in object_list %}
    <article class="entry">
        <h1><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h1>
        {% if user.is_authenticated %}
        <nav>
            <ul>
                <li class="entry-update"><a href="{% url 'blogs-entry-update' pk=object.pk %}">Update</a></li>
                <li class="entry-delete"><a href="{% url 'blogs-entry-delete' pk=object.pk %}">Delete</a></li>
            </ul>
        </nav>
        {% endif %}

        <section class="body">
            {{ object.body|linebreaks|truncatewords_html:50 }}
        </section>
    </article>
    {% endfor %}
</section>
{% endblock %}

