{% load cms_tags allink_cms_tags sekizai_tags i18n thumbnail allink_image_tags allink_link_tags %}

{% for object in object_list %}
    <div class="grid-item {% if appended %}appended{% endif %}">
        <div class="manage-spacings">
            {% if object.preview_image %}
                <div class="image-container">
                    {% if  instance.detail_link_enabled %}
                        <a href="{% get_absolute_url object instance.apphook_page.application_namespace %}">
                    {% endif %}
                        {% render_image image=object.preview_image %}
                    {% if  instance.detail_link_enabled %}
                        </a>
                    {% endif %}
                </div>
            {% endif %}
            {% if object.entry_date %}
                <div class="date-container">
                    {# Date format: https://docs.djangoproject.com/es/1.10/ref/templates/builtins/#std:templatefilter-date #}
                    {{ object.entry_date|date:"j.n.Y" }}
                </div>
            {% endif %}
            {% if object.title %}
                <div class="heading-container">
                    <h2 class="heading">
                        {% render_model_ajax object "title" %}
                    </h2>
                </div>
            {% endif %}
            {% if object.lead %}
                <div class="lead-container">
                    {{object.lead|striptags}}
                </div>
            {% endif %}
            {% if  instance.detail_link_enabled %}
                <div class="link-container">
                    <a href="{% get_absolute_url object instance.apphook_page.application_namespace %}" class="app-list__detail-link">
                        {% if instance.detail_link_text %}
                            {{ instance.detail_link_text }}
                        {% else %}
                            {% trans "More" %}
                        {% endif %}
                    </a>
                </div>
            {% endif %}
        </div>
    </div>
{% endfor %}
