{% extends "base_generic.html" %}

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

{% block heading %}{{ heading }}{% 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="#">
        <div class="table row">
          <div class="small-12 columns">
          {% csrf_token %}

            <div class="thead row">
              <div class="small-12 columns">
                <div class="view-listrow col-head row">
                  <div class="small-1 columns">
                    <span>&nbsp;</span>
                  </div>
                  <div class="view-label col-head small-4 columns">
                    <span>Id</span>
                  </div>
                  <div class="view-label col-head small-7 columns">
                    <span>Label</span>
                  </div>
                </div>
              </div>
            </div>

            {% for c, v in collections.items %}
            <div class="tbody row">
              <div class="small-12 columns">
                <div class="view-listrow row">
                  <div class="small-1 columns">
                    {% if auth_delete_coll %}
                    <input type="checkbox" name="select" value="{{c}}" class="right" />
                    {% else %}
                    <span>&nbsp;</span>
                    {% endif %}
                  </div>
                  <div class="view-value small-4 columns">
                    <a href="{{v.url}}">{{c}}</a>
                  </div>
                  <div class="view-value small-7 columns">
                    <span>{{v.title}}</span>
                  </div>
                </div>
              </div>
            </div>
            {% endfor %}

            {% if auth_delete_coll %}
            <div class="row">
              <div class="small-1 columns">
                <span>&nbsp;</span>
              </div>
              <div class="small-11 columns">
                <input type="submit" value="View metadata" name="view" />
                <input type="submit" value="Edit metadata" name="edit" />
                <input type="submit" value="Remove selected" name="remove" />
              </div>
            </div>
            <!-- original:
            <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_coll %}
            <div class="row">
              <div class="small-12 columns">
                <div class="view-listrow row">
                  <div class="small-1 columns">
                    <span>&nbsp;</span>
                  </div>
                  <div class="view-value small-4 columns">
                    <input type="text" size="32" name="new_id" value=""/>
                  </div>
                  <div class="view-value small-7 columns">
                    <input type="text" size="64" name="new_label" value=""/>
                  </div>
                </div>
              </div>
            </div>
            <div class="row">
              <div class="small-1 columns">
                <span>&nbsp;</span>
              </div>
              <div class="view-value small-11 columns">
                <input type="submit" value="New collection" name="new" />
              </div>
            </div>
            <!-- original:
            <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>
              <div class="small-2 columns">
                <input type="submit" value="New" name="new" class="right" />
              </div>
            </div>
            -->
            {% endif %}

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