{% extends "base_generic.html" %}

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

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

{% block content %}

<!--
<div class="row">
  <div class="large-12 columns">
    <h3>'{{type_id}}' data in collection '{{coll_id}}'</h3>
  </div>
</div>
-->

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

      <div class="row">
        {% for field in fields %}
        {% include field.field_render_label_edit %}
        {% 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-4 columns">
          <div class="row">
            <div class="form-buttons small-12 columns">
              <input type="submit" name="save"          value="Save" />
              <input type="submit" name="view"          value="View" />
              <input type="submit" name="cancel"        value="Cancel" />
            </div>
          </div>
        </div>
        <div class="small-6 columns">
          <div class="row">
            <div class="form-buttons small-12 columns text-right">
              &nbsp;
              {% for b in task_buttons %}
              <input type="submit" name="{{b.button_name}}" value="{{b.button_label}}" />
              {% endfor %}
              {% if auth_config and edit_view_button and edit_view_button != "no" %}
              <input type="submit" name="open_view"       value="Edit view" />
              {% endif %}
            </div>
          </div>
        </div>
      </div>

      <hr />
      <div class="row">
 
        {% with field=view_choices %}
        {% include field.field_render_label_edit %}
        {% endwith %}

        {% comment "New type/view/field/group buttons suppressed for now" %}
        {% if auth_config %}
        <div class="small-12 medium-6 columns medium-text-right">
          <div class="row">
            <div class="small-12 columns">
              <input type="submit" name="new_type"      value="New type" />
              <input type="submit" name="new_view"      value="New view" />
              <input type="submit" name="new_field"     value="New field type" />
              <input type="submit" name="new_group"     value="New field group" />
            </div>
          </div>
        </div>
        {% endif %}
        {% endcomment %}  

      </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 %}
