2021-01-31 00:33:41 -05:00
|
|
|
{% extends 'layout.html' %}
|
|
|
|
{% block content %}
|
|
|
|
|
2021-01-31 11:08:52 -05:00
|
|
|
<header class="block">
|
|
|
|
<h1 class="title">Lists</h1>
|
|
|
|
</header>
|
2021-01-31 20:34:06 -05:00
|
|
|
{% if request.user.is_authenticated and not lists.has_previous %}
|
2021-01-31 11:41:11 -05:00
|
|
|
<section class="block content">
|
2021-01-31 11:08:52 -05:00
|
|
|
<header class="columns">
|
|
|
|
<div class="column">
|
2021-01-31 11:41:11 -05:00
|
|
|
<h2 class="title">Your lists</h2>
|
2021-01-31 11:08:52 -05:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
2021-02-02 18:46:58 -05:00
|
|
|
{% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text="Create new list" focus="create-list-header" %}
|
2021-01-31 11:08:52 -05:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
2021-01-31 11:41:11 -05:00
|
|
|
<form name="create-list" method="post" action="{% url 'lists' %}" class="box hidden" id="create-list">
|
2021-01-31 15:36:53 -05:00
|
|
|
<header class="columns">
|
2021-02-02 18:46:58 -05:00
|
|
|
<h3 class="title column" tabindex="0" id="create-list-header">Create list</h3>
|
2021-01-31 15:36:53 -05:00
|
|
|
<div class="column is-narrow">
|
2021-02-02 18:46:58 -05:00
|
|
|
{% include 'snippets/toggle/toggle_button.html' with controls_text="create-list" label="Close" class="delete" nonbutton=True %}
|
2021-01-31 15:36:53 -05:00
|
|
|
</div>
|
|
|
|
</header>
|
2021-01-31 13:34:25 -05:00
|
|
|
{% include 'lists/form.html' %}
|
2021-01-31 11:08:52 -05:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if request.user.list_set.exists %}
|
2021-01-31 20:34:06 -05: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 14:34:08 -05:00
|
|
|
<a href="{% url 'user-lists' request.user.localname %}">See all {{ request.user.list_set.count}} lists</a>
|
2021-01-31 11:08:52 -05:00
|
|
|
{% endif %}
|
|
|
|
</section>
|
2021-01-31 00:33:41 -05:00
|
|
|
{% endif %}
|
|
|
|
|
2021-01-31 20:34:06 -05:00
|
|
|
|
|
|
|
{% if lists %}
|
2021-01-31 11:41:11 -05:00
|
|
|
<section class="block content">
|
|
|
|
<h2 class="title">Recent Lists</h2>
|
2021-01-31 17:03:38 -05:00
|
|
|
{% if request.user.list_set.exists %}
|
|
|
|
{% include 'lists/list_items.html' with lists=lists %}
|
|
|
|
{% endif %}
|
2021-01-31 11:08:52 -05:00
|
|
|
</section>
|
2021-01-31 20:34:06 -05:00
|
|
|
<div>
|
|
|
|
{% include 'snippets/pagination.html' with page=lists path=path %}
|
|
|
|
</div>
|
2021-01-31 11:08:52 -05:00
|
|
|
{% endif %}
|
2021-01-31 00:33:41 -05:00
|
|
|
|
|
|
|
{% endblock %}
|