2021-01-31 00:33:41 -05:00
|
|
|
{% extends 'layout.html' %}
|
2021-02-27 21:48:10 -05:00
|
|
|
{% load i18n %}
|
2021-02-28 13:00:36 -05:00
|
|
|
|
|
|
|
{% block title %}{% trans "Lists" %}{% endblock %}
|
|
|
|
|
2021-01-31 00:33:41 -05:00
|
|
|
{% block content %}
|
|
|
|
|
2021-01-31 11:08:52 -05:00
|
|
|
<header class="block">
|
2021-02-27 21:48:10 -05:00
|
|
|
<h1 class="title">{% trans "Lists" %}</h1>
|
2021-01-31 11:08:52 -05:00
|
|
|
</header>
|
2021-01-31 20:34:06 -05:00
|
|
|
{% if request.user.is_authenticated and not lists.has_previous %}
|
2021-02-23 16:04:24 -05:00
|
|
|
<header class="block columns is-mobile">
|
2021-02-03 15:25:33 -05:00
|
|
|
<div class="column">
|
2021-02-27 21:48:10 -05:00
|
|
|
<h2 class="title">{% trans "Your lists" %}</h2>
|
2021-02-03 15:25:33 -05:00
|
|
|
</div>
|
|
|
|
<div class="column is-narrow">
|
2021-02-28 20:10:30 -05:00
|
|
|
{% trans "Create List" as button_text %}
|
|
|
|
{% include 'snippets/toggle/open_button.html' with controls_text="create-list" icon="plus" text=button_text focus="create-list-header" %}
|
2021-02-03 15:25:33 -05:00
|
|
|
</div>
|
|
|
|
</header>
|
2021-01-31 11:08:52 -05:00
|
|
|
|
2021-02-03 15:25:33 -05:00
|
|
|
<div class="block">
|
|
|
|
{% include 'lists/create_form.html' with controls_text="create-list" %}
|
|
|
|
</div>
|
2021-01-31 11:08:52 -05:00
|
|
|
|
2021-02-03 21:09:07 -05:00
|
|
|
<section class="block content">
|
2021-01-31 11:08:52 -05:00
|
|
|
{% 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-03-02 13:23:11 -05:00
|
|
|
<a href="{% url 'user-lists' request.user.localname %}">{% blocktrans with size=request.user.list_set.count %}See all {{ size }} lists{% endblocktrans %}</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">
|
2021-02-27 21:48:10 -05:00
|
|
|
<h2 class="title">{% trans "Recent Lists" %}</h2>
|
2021-01-31 17:03:38 -05:00
|
|
|
{% include 'lists/list_items.html' with lists=lists %}
|
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 %}
|