work on lists

This commit is contained in:
bkfox
2015-10-13 17:52:59 +02:00
parent c69ef73a94
commit 474a33cfa5
9 changed files with 105 additions and 27 deletions

View File

@ -4,7 +4,7 @@
{% load thumbnail %}
{% block content %}
<div class="post_list {{ classes }}">
<div class="post_list {{ classes }} {% if embed %}embed{% endif %}">
{% for post in object_list %}
<a class="post_item"
href="{{ post.detail_url }}">
@ -39,6 +39,27 @@
</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 %}

View File

@ -23,12 +23,12 @@
{% endblock %}
</div>
{% if bottom %}
<div class="section_bottom">
{% block section_bottom %}
{{ bottom }}
{% if footer %}
<footer class="section_footer">
{% block section_footer %}
{{ footer }}
{% endblock %}
</div>
</footer>
{% endif %}
{% endblock %}
{% endblock %}