{% extends 'base.html' %}
{% load i18n %}
{% block content %}
<div class="articles-wrapper">
{% for actu in object_list %}
<article class="article">
    <h2><a href="{{ actu.get_absolute_url }}">{{ actu.title }}</a></h2>
    {% if actu.image %}
        <img src="{{ actu.image.url }}" alt="{{ actu.title }}" class="article-image" />
    {% endif %}
    {% if actu.excerpt %}
    {{ actu.excerpt|truncatewords_html:40|safe }}
    {% else %}
    {{ actu.story|truncatewords_html:40|safe }}
    {% endif %}
    <p><a href="{{ actu.get_absolute_url }}" class="readmore">{% trans "Read more" %}</a></p>
    <p class="more-info">{% trans "Posted on" %} {{actu.date_pub|date:"d E Y"}}
        {% if actu.categories.exists %}
        {% trans "in categories" %} {% for category in actu.categories.all %}<a href="{{category.get_absolute_url}}">{{category.name}}</a>
        {% if not forloop.last %}, {% endif %}
        {% endfor %}{% endif %}</p>

</article>
{% empty %}
<p>{% trans "No posts found." %}</p>
{% endfor %}
</div>
{% endblock %}
