Files
sigl/sigl/templates/lists/home.html.j2
2022-07-14 14:14:50 -07:00

28 lines
1.2 KiB
Django/Jinja

{% extends 'base.html.j2' %}
{% block title %}Home | Sigl{% endblock %}
{% block header %}
<div class="flex justify-between items-center py-2">
<div class="text-lg font-bold text-gray-800">All Lists</div>
<a href="{{ url_for('lists.create') }}" class="px-2 py-1 text-sm text-white bg-green-600 hover:bg-green-700 border rounded flex justify-between items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
New List
</a>
</div>
{% endblock %}
{% block main %}
{% if lists|length == 0 %}
<div class="py-2 border-b border-gray-300">
<div class="ml-4">No shopping lists</div>
</div>
{% else %}
<ul class="w-full">
{% for lst in lists %}
<li class="block w-full py-2{% if not loop.last %} border-b border-gray-300{% endif %}">
<a href="{{ url_for('lists.detail', id=lst.id) }}"><div class="px-4">{{ lst.name }} ({{ lst.entries|length }} Items)</div></a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endblock %}