{% extends "base_generic.html" %}

{% block title %}{{ title }}{% endblock %}

{% block heading %}{{ title }}{% endblock %}

{% block content %}

    <div class="row">
        <div class="large-12 columns">
            <h3>Collections</h3>
        </div>
    </div>

    <div class="row">
        <div class="large-12 columns">
            <form method="POST" action="">
                {% csrf_token %}

                <div class="row headings">
                    <div class="small-3 columns">
                        <p>Id</p>
                    </div>
                    <div class="small-7 columns">
                        <p>Label</p>
                    </div>
                    <div class="small-2 columns">
                    </div>
                </div>

                {% for c, v in collections.items %}
                <div class="row">
                    <div class="small-3 columns">
                        <p><a href="{{v.url}}">{{c}}</a></p>
                    </div>
                    <div class="small-7 columns">
                        <p>{{v.title}}</p>
                    </div>
                    <div class="small-2 columns">
                        {% if auth_delete %}
                        <p><input type="checkbox" name="select" value="{{c}}" class="right" /></p>
                        {% endif %}
                    </div>
                </div>
                {% endfor %}

                {% if auth_delete %}
                <div class="row">
                    <div class="small-3 columns right">
                        <input type="submit" value="Remove selected" name="remove" class="right" />
                    </div>
                </div>
                {% endif %}

                {% if auth_create %}
                <div class="row">
                    <div class="small-3 columns">
                        <input type="text" size="32" name="new_id" value=""/>
                    </div>
                    <div class="small-7 columns">
                        <input type="text" size="64" name="new_label" value=""/>
                    </div>
                    {% if auth_delete %}
                    <div class="small-2 columns">
                        <input type="submit" value="New" name="new" class="right" />
                    </div>
                    {% endif %}
                </div>
                {% endif %}

            </form>
        </div>
    </div>
{% endblock %}
