{% extends "fluent_blogs/entry_contents_base.html" %}
{% load i18n fluent_blogs_tags %}{% comment %}

  This is a base template for an item in the archive.
  It extends from a shared template so it can display the same content
  in both the archive and detail pages. However, this is not required.
  You can completely replace this template and leave the extends out.

  To shorten the contents in the archive, use:
  {% block entry-body-contents %}{{ object.html_content|truncatewords_html:100|safe }}{% endblock %}
  or provide an excerpt_text field in the model (e.g. via ExcerptTextEntryMixin).

{% endcomment %}

{% block entry-body %}
  {% if object.excerpt_text %}
      {% comment %}
        This code only exists to show something reasonable out of the box
        when you included the ExcerptTextEntryMixin or ExcerptImageEntryMixin.
        Feel free to completely redefine this template in your site
      {% endcomment %}
      <div class="entry-excerpt">
          {% if object.excerpt_image %}
              <div class="entry-excerpt-image">
                  <img src="{{ object.excerpt_image.url }}" />
              </div>
          {% endif %}
          <div class="entry-excerpt-text">
            {{ object.excerpt_text|safe }}
          </div>
          <a class="more" href="{{ entry_url }}">{% trans "Read More" %} &gt;</a>
      </div>
  {% else %}
    {{ block.super }}
  {% endif %}
{% endblock %}

{% block entry-footer-contents %}
    {{ block.super }}

    {# Archive typically gives short summary, whereas the details page displays the full set of comments #}
    <p class="entry-meta">
      {% get_entry_url object as entry_url %}
      {% if comment_count %}
        <a href="{{ entry_url }}#comments" title="{{ object.title }}">{% blocktrans count comment_count as comment_count %}{{ comment_count }} comment{% plural %}{{ comment_count }} comments{% endblocktrans %}</a>
      {% else %}
        {% if object.comments_are_open %}{# no comments are closed message here, only encourage to post #}
          <a href="{{ comments_url }}" title="{{ object.title }}">{% trans "Post a comment" %}</a>
        {% endif %}
      {% endif %}

      {% if pingback_count %}<a href="{{ entry_url }}#pingbacks" title="{{ object.title }}">{% blocktrans count pingback_count as pingback_count %}{{ pingback_count }} pingback{% plural %}{{ pingback_count }} pingbacks{% endblocktrans %}</a>{% endif %}
      {% if trackback_count %}<a href="{{ entry_url }}#trackbacks" title="{{ object.title }}">{% blocktrans count trackback_count as trackback_count %}{{ trackback_count }} trackback{% plural %}{{ trackback_count }} trackbacks{% endblocktrans %}</a>{% endif %}
    </p>
{% endblock %}
