Paginates lists view
This commit is contained in:
@ -4,8 +4,7 @@
|
||||
<header class="block">
|
||||
<h1 class="title">Lists</h1>
|
||||
</header>
|
||||
|
||||
{% if request.user.is_authenticated %}
|
||||
{% if request.user.is_authenticated and not lists.has_previous %}
|
||||
<section class="block content">
|
||||
<header class="columns">
|
||||
<div class="column">
|
||||
@ -27,18 +26,26 @@
|
||||
</form>
|
||||
|
||||
{% if request.user.list_set.exists %}
|
||||
{% include 'lists/list_items.html' with lists=request.user.list_set.all %}
|
||||
{% include 'lists/list_items.html' with lists=request.user.list_set.all|slice:4 %}
|
||||
{% endif %}
|
||||
|
||||
{% if request.user.list_set.count > 4 %}
|
||||
<a href="{{ request.user.local_path }}/lists">See all {{ request.user.list_set.count}} lists</a>
|
||||
{% endif %}
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if lists.exists %}
|
||||
|
||||
{% if lists %}
|
||||
<section class="block content">
|
||||
<h2 class="title">Recent Lists</h2>
|
||||
{% if request.user.list_set.exists %}
|
||||
{% include 'lists/list_items.html' with lists=lists %}
|
||||
{% endif %}
|
||||
</section>
|
||||
<div>
|
||||
{% include 'snippets/pagination.html' with page=lists path=path %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
Reference in New Issue
Block a user