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-01-31 05:33:41 +00:00
|
|
|
{% if request.user.is_authenticated %}
|
2021-01-31 16:41:11 +00:00
|
|
|
<section class="block content">
|
2021-01-31 16:08:52 +00:00
|
|
|
<header class="columns">
|
|
|
|
<div class="column">
|
2021-01-31 16:41:11 +00:00
|
|
|
<h2 class="title">Your lists</h2>
|
2021-01-31 16:08:52 +00:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
{% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text="Create new list" %}
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
|
2021-01-31 16:41:11 +00:00
|
|
|
<form name="create-list" method="post" action="{% url 'lists' %}" class="box hidden" id="create-list">
|
2021-01-31 20:36:53 +00:00
|
|
|
<header class="columns">
|
|
|
|
<h3 class="title column">Create list</h3>
|
|
|
|
<div class="column is-narrow">
|
|
|
|
{% include 'snippets/toggle/toggle_button.html' with controls_text="create-list" label="close" class="delete" nonbutton=True %}
|
|
|
|
</div>
|
|
|
|
</header>
|
2021-01-31 18:34:25 +00:00
|
|
|
{% include 'lists/form.html' %}
|
2021-01-31 16:08:52 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
{% if request.user.list_set.exists %}
|
2021-01-31 22:03:38 +00:00
|
|
|
{% include 'lists/list_items.html' with lists=request.user.list_set.all %}
|
2021-01-31 16:08:52 +00:00
|
|
|
{% endif %}
|
|
|
|
</section>
|
2021-01-31 05:33:41 +00:00
|
|
|
{% endif %}
|
|
|
|
|
2021-01-31 16:08:52 +00:00
|
|
|
{% if lists.exists %}
|
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
|
|
|
{% if request.user.list_set.exists %}
|
|
|
|
{% include 'lists/list_items.html' with lists=lists %}
|
|
|
|
{% endif %}
|
2021-01-31 16:08:52 +00:00
|
|
|
</section>
|
|
|
|
{% endif %}
|
2021-01-31 05:33:41 +00:00
|
|
|
|
|
|
|
{% endblock %}
|