nephila/djangocms-blog

View on GitHub
djangocms_blog/templates/djangocms_blog/includes/blog_item.html

Summary

Maintainability
Test Coverage
{% load djangocms_blog i18n easy_thumbnails_tags cms_tags %}

<article id="post-{{ post.slug }}" class="post-item">
    <header>
        <h3><a href="{{ post.get_absolute_url }}">{{ post.title }}</a></h3>
        {% if post.subtitle %}
            <h4>{{ post.subtitle }}</h4>
        {% endif %}
        {% block blog_meta %}
            {% include "djangocms_blog/includes/blog_meta.html" %}
        {% endblock %}
    </header>
    {% if image and post.main_image %}
    <div class="blog-visual">
        {% thumbnail post.main_image post.thumbnail_options.size crop=post.thumbnail_options.crop upscale=post.thumbnail_options.upscale subject_location=post.main_image.subject_location as thumb %}
        <img src="{{ thumb.url }}" alt="{{ post.main_image.default_alt_text }}" width="{{ thumb.width }}" height="{{ thumb.height }}" />
    </div>
    {% else %}
        {% media_images post as previews %}
        <div class="blog-visual">
          {% for preview in previews %}<img src="{{ preview }}" />{% endfor %}
        </div>
    {% endif %}
    <div class="blog-lead">
        {% if not TRUNCWORDS_COUNT %}
            {% render_model post "abstract" "" "" "safe" %}
        {% else %}
            {% render_model post "abstract" "" "" "truncatewords_html:TRUNCWORDS_COUNT|safe"  %}
        {% endif %}
    </div>
    <footer class="read-more">
        <a href="{{ post.get_absolute_url }}">{% trans "read more" %} &raquo;</a>
    </footer>
</article>