{% extends "egonomy_base.html" %}
{% load static %}
{% load i18n %}
{% load thumbnail %}
{% load navigation %}

{% block title %}{% trans "All collections" %}{% endblock %}

{% block css_page %}
<style>
.bar-tools:first-child {
    background-position: bottom center;
}
</style>
{% endblock %}

{% block popins %}
        <div id="new-collection" class="popin popin-new-collection box-shadow">
            <header>
                <h2>{% trans "New collection" %}</h2>
                <a href="#" class="close-popin"></a>
            </header>
            <section>
                <form action="{% url 'save_collection' %}" method="POST">
                    <p>
                        <label for="collection-title">{% trans "Title" %} :</label>
                        <input type="text" name="collection-title" id="collection-title">
                    </p>
                    <p>
                        <label class="block" for="collection-description">{% trans "Description" %} :</label>
                        <textarea name="collection-description" id="collection-description"></textarea>
                    </p>
                    <div class="buttons">
                        <a href="#" class="btn close-popin">{% trans "Cancel" %}</a>
                        <input class="btn" type="submit" value="{% trans 'Submit' %}">
                    </div>{% csrf_token %}
                </form>
            </section>
        </div>
{% endblock %}

{% block content %}
            <div class="bar-tools clearfix">
              {% if user_collections %}
                <h3>{% blocktrans count counter=results|length %}My collection{% plural %}My {{ counter }} collections{% endblocktrans %}</h3>
              {% else %}
                <h3>{% trans "All collections" %}</h3>
              {% endif %}
                <ul class="clearfix">
                    <li><a class="open-popin" href="#new-collection">{% trans "New collection" %}</a></li>
                </ul>
            </div>
            {% if nb_pages > 1 %}{% build_pagination nb_pages cur_page_nb url_pagination "clickable" %}{% endif %}
            <ul class="list-style-2 clearfix no-border-bot">
              {% for col in results %}
                <li class="subcol-fourth">
                {% include "partial/collection_in_list.html" %}
                </li>
              {% endfor %}
            </ul>
            {% if nb_pages > 1 %}<p>{% build_pagination nb_pages cur_page_nb url_pagination "clickable" %}</p>{% endif %}
{% endblock %}

