2021-01-31 05:33:41 +00:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% block content %}
|
|
|
|
|
2021-01-31 16:08:52 +00:00
|
|
|
<header class="block">
|
|
|
|
<h1 class="title">Lists</h1>
|
|
|
|
</header>
|
2021-02-01 01:34:06 +00:00
|
|
|
{% if request.user.is_authenticated and not lists.has_previous %}
|
2021-02-03 20:25:33 +00:00
|
|
|
<header class="block columns">
|
|
|
|
<div class="column">
|
|
|
|
<h2 class="title">Your lists</h2>
|
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
{% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text="Create new list" focus="create-list-header" %}
|
|
|
|
</div>
|
|
|
|
</header>
|
2021-01-31 16:08:52 +00:00
|
|
|
|
2021-02-03 20:25:33 +00:00
|
|
|
<div class="block">
|
|
|
|
{% include 'lists/create_form.html' with controls_text="create-list" %}
|
|
|
|
</div>
|
2021-01-31 16:08:52 +00:00
|
|
|
|
2021-02-04 02:09:07 +00:00
|
|
|
<section class="block content">
|
2021-01-31 16:08:52 +00:00
|
|
|
{% if request.user.list_set.exists %}
|
2021-02-01 01:34:06 +00:00
|
|
|
{% include 'lists/list_items.html' with lists=request.user.list_set.all|slice:4 %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if request.user.list_set.count > 4 %}
|
2021-02-01 19:34:08 +00:00
|
|
|
<a href="{% url 'user-lists' request.user.localname %}">See all {{ request.user.list_set.count}} lists</a>
|
2021-01-31 16:08:52 +00:00
|
|
|
{% endif %}
|
|
|
|
</section>
|
2021-01-31 05:33:41 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2021-02-01 01:34:06 +00:00
|
|
|
|
|
|
|
{% if lists %}
|
2021-01-31 16:41:11 +00:00
|
|
|
<section class="block content">
|
|
|
|
<h2 class="title">Recent Lists</h2>
|
2021-01-31 22:03:38 +00:00
|
|
|
{% include 'lists/list_items.html' with lists=lists %}
|
2021-01-31 16:08:52 +00:00
|
|
|
</section>
|
2021-02-01 01:34:06 +00:00
|
|
|
<div>
|
|
|
|
{% include 'snippets/pagination.html' with page=lists path=path %}
|
|
|
|
</div>
|
2021-01-31 16:08:52 +00:00
|
|
|
{% endif %}
|
2021-01-31 05:33:41 +00:00
|
|
|
|
|
|
|
{% endblock %}
|