nephila/djangocms-blog

View on GitHub
djangocms_blog/templates/djangocms_blog/post_detail.html

Summary

Maintainability
Test Coverage
{% extends "djangocms_blog/base.html" %}
{% load i18n easy_thumbnails_tags cms_tags %}

{% block canonical_url %}<link rel="canonical" href="{{ meta.url }}"/>{% endblock canonical_url %}
{% block title %}{{ post.get_title }}{% endblock %}

{% block content_blog %}{% spaceless %}
<article id="post-{{ post.slug }}" class="post-item post-detail">
    <header>
        <h2>{% render_model post "title" %}</h2>
        {% if post.subtitle %}
            <h3>{% render_model post "subtitle" %}</h3>
        {% endif %}
        {% block blog_meta %}
            {% include "djangocms_blog/includes/blog_meta.html" %}
        {% endblock %}
    </header>
    {% if not post.main_image_id %}
        <div class="blog-visual">{% render_placeholder post.media %}</div>
    {% else %}
    <div class="blog-visual">
        {% thumbnail post.main_image post.full_image_options.size crop=post.full_image_options.crop upscale=post.full_image_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>
    {% endif %}
    {% endspaceless %}
    {% if post.app_config.use_placeholder %}
        <div class="blog-content">{% render_placeholder post.content %}</div>
    {% else %}
        <div class="blog-content">{% render_model post "post_text" "post_text" "" "safe" %}</div>
    {% endif %}
    {% if view.liveblog_enabled %}
        {% include "liveblog/includes/post_detail.html" %}
    {% endif %}
    {% if post.related.exists %}
        <section class="post-detail-list">
        {% for related in post.related.all %}
            {% include "djangocms_blog/includes/blog_item.html" with post=related image="true" TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}
        {% endfor %}
        </section>
    {% endif %}
</article>
{% endblock content_blog %}