{% extends "base_generic.html" %}

{% load staticfiles %}

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

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

{% block content %}

  <div class="row">
    <div class="large-12 columns">
      {% if list_label %}
      <h3>{{list_label}}</h3>
      {% elif list_id %}
      <h3>List '{{list_id}}' of entities in collection '{{coll_id}}'</h3>
      {% else %}
      <h3>List of entities in collection '{{coll_id}}'</h3>
      {% endif %}
    </div>
  </div>

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

        <!-- - - - - -  search and list view selection - - - - - -->
        <div class="row">
          <!-- Search term entry -->
          <div class="small-12 medium-5 columns">
            <div class="view-value-row row">
              <div class="view-label small-12 medium-3 columns">
                <span>Search</span>
              </div>
              <div class="view-value small-12 medium-9 columns end">
                <input type="text" name="search_for" value="{{search_for}}" />
              </div>
            </div>
          </div>
          <!-- List view entry -->
          {% with field=list_choices %}
          {% include field.field_render_label_edit %}
          {% endwith %}
          <!-- View (refresh) button -->
          <div class="small-12 medium-2 columns text-right">
            <div class="view-value-row row">
              <div class="small-12 columns right">
                <input type="submit" name="view" value="View" 
                       title="View entities from current collection" />
                <input type="submit" name="view_all" value="View all" 
                       title="View collection and site-wide entities" />
                <!--
                <button type="submit" name="search" value="Search">
                <img src="{% static 'images/icons/search_32.png' %}"/>
                </button>
                -->
              </div>
            </div>
          </div>
        </div>

        <!-- - - - - -  table data - - - - - -->
        <div class="table row">
          <div class="small-12 columns">
            {% include List_rows.field_render_view with field=List_rows %}
          </div>
        </div>
        <!-- - - - - -  table ends - - - - - -->

        <div class="row">
          <div class="form-buttons small-12 columns">
            <input type="submit" name="new"             value="New" />
            <input type="submit" name="copy"            value="Copy" />
            <input type="submit" name="edit"            value="Edit" />
            <input type="submit" name="delete"          value="Delete" />
          </div>
          <div class="small-3 columns">
            <input type="submit" name="close"           value="Close" />
          </div>
          <div class="small-9 columns text-right">
            <!-- list_id:{{list_id}}, list_id_url:{{list_id_url}} -->
            <input type="submit" name="default_view"    value="Set default" {{default_view_enable}} />
            <input type="submit" name="customize"       value="Customize" />
          </div>
          <input type="hidden" name="continuation_url"    value="{{continuation_url}}"/>
        </div>
      </form>
    </div>
  </div>

{% endblock %}
