{% extends "todo/base.html" %}
{% load url from future %}

{% block title %}{{ list_title }} Todo Lists{% endblock %}

{% block content %}


    {% if messages %}
    <ul class="messages">
        {% for message in messages %}
        <li>{{ message }}</li>
        {% endfor %}
    </ul>
    {% endif %}

   <h1>To-do Lists</h1>
   
   <p>{{ item_count }} items in {{ list_count }} lists</p>

   	{% regroup list_list by group as section_list %}

    {% for group in section_list %}
        <h3>{{ group.grouper }}</h3>
        <ul>
            {% for item in group.list %}
   	            <li><a class="todo" href="{% url 'todo-incomplete_tasks' item.id item.slug %}">{{ item.name }} </a> ({{ item.incomplete_tasks.count }}/{{ item.item_set.count }})</li>
            {% endfor %}
        </ul>

    {% endfor %}

    

    <div class="todo-break">
    &nbsp;
    </div>

    <p><a href="{% url 'todo-add_list' %}">Create new todo list</a></p>
	
{% endblock %}
