aircox-radiocampus/cms/templates/aircox/cms/list.html

65 lines
1.8 KiB
HTML

{% extends "aircox/cms/website.html" %}
{% load i18n %}
{% load thumbnail %}
{% load aircox_cms %}
{% block content %}
<ul class="content">
{% for item in object_list %}
{% include "aircox/cms/list_item.html" %}
{% empty %}
<div class="message empty">
{{ list.message_empty }}
</div>
{% endfor %}
</ul>
{% if object_list and not embed %}
{% if list.url or page_obj %}
<nav>
{% if not page_obj or embed %}
{% comment %}link to show more elements of the list{% endcomment %}
<a href="{{list.url}}">{% trans "&#8226;&#8226;&#8226;" %}</a>
{% elif page_obj.paginator.num_pages > 1 %}
{% with page_obj.paginator.num_pages as num_pages %}
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}">previous</a>
{% endif %}
{% if page_obj.number > 3 %}
<a href="?page=1">1</a>
{% if page_obj.number > 4 %}
&#8230;
{% endif %}
{% endif %}
{% for i in page_obj.number|around:2 %}
{% if i == page_obj.number %}
{{ page_obj.number }}
{% elif i > 0 and i <= num_pages %}
<a href="?page={{ i }}">{{ i }}</a>
{% endif %}
{% endfor %}
{% with page_obj.number|add:"2" as max %}
{% if max < num_pages %}
{% if max|add:"1" < num_pages %}
&#8230;
{% endif %}
<a href="?page={{ num_pages }}">{{ num_pages }}</a>
{% endif %}
{% endwith %}
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}">next</a>
{% endif %}
{% endwith %}
{% endif %}
</nav>
{% endif %}
{% endif %}
{% endblock %}