{% extends "base_generic.html" %}

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

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

{% block content %}

{% load static %}

<div class="row">
  <div class="large-12 columns">
    <form method="POST" action="#">
      {% csrf_token %}
      <!-- Hidden button is default when ENTER key is pressed -->
      <!-- see http://stackoverflow.com/questions/1963245/    -->
      <input type="submit" name="close" value="Close" style="display:none;" />

      <div class="row">
        {% for field in fields %}
        {% include field.field_render_label_view %}
        {% endfor %}
      </div>

      <div class="row">
        <div class="medium-2 columns show-for-medium-up">
          <div class="row">
            <div class="small-12 columns">
              &nbsp;
            </div>
          </div>
        </div>
        <div class="small-12 medium-4 columns">
          <div class="row">
            <div class="form-buttons small-12 columns">
              <input type="submit" name="edit"  value="Edit" 
                     title="Edit entity data."/>
              <input type="submit" name="copy"  value="Copy" 
                     title="Copy, then edit entity data as new entity." />
              <input type="submit" name="close" value="Close" 
                     title="Return to previous page." />
            </div>
          </div>
        </div>
        <div class="small-12 medium-6 columns">
          <div class="row">
            <div class="form-buttons small-12 columns medium-up-text-right">
              {% for b in view_task_buttons %}
              <input type="submit" name="{{b.button_name}}" value="{{b.button_label}}" 
                     title="{{b.button_help}}"/>
              {% endfor %}
              {% if edit_view_button and edit_view_button != "no" %}
              <input type="submit" name="open_view"        value="View description" 
                     title="Open view definition for the current display."/>
              {% endif %}
              <input type="submit" name="default_view" value="Set default view"
                     title="Select this display as the default view for collection '{{coll_id}}'."
                     {{default_view_enable}} />
              <input type="submit" name="customize"    value="Customize"
                     title="Open 'Customize' view for collection '{{coll_id}}'."
                     {{customize_view_enable}} />
            </div>
          </div>
        </div>
      </div>

      <!-- View options -->
      <div class="row">

        {% with field=view_choices %}
        {% include field.field_render_label_edit %}
        {% endwith %}

        <div class="small-12 medium-6 columns text-right medium-up-text-right">
          <div class="row view-value-row">
            <div class="view-value small-12 columns">
              <!-- Cf. https://github.com/BetaNYC/getDataButton -->
              <a href="{{entity_data_ref}}" title="Retrieve underlying data as JSON-LD">JSON-LD</a>
              <a href="{{entity_data_ref_json}}" title="Retrieve underlying JSON data">
                <img src="{% static 'images/get_the_data_88x31.png' %}" alt="get_the_data">
              </a>
            </div>
          </div>
        </div>

      </div>

      <input type="hidden" name="orig_id"          value="{{orig_id}}" />
      <input type="hidden" name="orig_type"        value="{{orig_type}}" />
      <input type="hidden" name="action"           value="{{action}}" />
      <input type="hidden" name="view_id"          value="{{view_id}}" />
      <input type="hidden" name="continuation_url" value="{{continuation_url}}" />
    </form>
  </div>
</div>

{% endblock %}
