aircox-radiocampus/aircox/cms/templates/aircox_cms/list.html
2015-12-01 16:16:45 +01:00

66 lines
1.9 KiB
HTML

{% extends embed|yesno:"aircox_cms/base_content.html,aircox_cms/base_site.html" %}
{% load i18n %}
{% load thumbnail %}
{% block content %}
<div class="post_list {{ classes }} {% if embed %}embed{% endif %}">
{% for post in object_list %}
<a class="post_item"
href="{{ post.detail_url }}">
{% if 'date' in view.fields or 'time' in view.fields %}
<time datetime="{{ post.date }}" class="post_datetime">
{% if 'date' in view.fields %}
<span class="post_date">
{{ post.date|date:'D. d F' }}
</span>
{% endif %}
{% if 'time' in view.fields %}
<span class="post_time">
{{ post.date|date:'H:i' }}
</span>
{% endif %}
</time>
{% endif %}
{% if 'image' in view.fields %}
<img src="{% thumbnail post.image view.icon_size crop %}" class="post_image">
{% endif %}
{% if 'title' in view.fields %}
<h3 class="post_title">{{ post.title }}</h3>
{% endif %}
{% if 'content' in view.fields %}
<div class="post_content">
{{ post.content|safe|striptags|truncatechars:"64" }}
</div>
{% endif %}
</a>
{% endfor %}
</div>
<nav>
{% if embed %}
{% with view.get_url as list_url %}
{% if list_url %}
<a href="{{list_url}}" title="More elements">&#8690;</a>
{% endif %}
{% endwith %}
{% else %}
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
<span class="current">
{{ page_obj.number }} / {{ page_obj.paginator.num_pages }}
</span>
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">next</a>
{% endif %}
{% endif %}
</nav>
{% endblock %}