{% extends "telemeta/collection_detail.html" %}
{% load i18n %}
{% load telemeta_utils %}

{% block title %}
    <img src="{% url telemeta-images "collections_red.png" %}" style="vertical-align:middle" /> Collection : {{ collection }}
{% endblock %}
{% block title_buttons %}
    <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
{% endblock %}

{% block infos %}
     <div class="infos">
      <form method="post" id="_editCollectionForm" action="">{% csrf_token %}
       <table>
       <tr><td colspan="2">{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</td></tr>
       {% for field in form %}
       <tr>
        {% if field.html_name == "copied_from_item" or field.html_name == "doctype_code" %}
            <td>{{ field.label_tag.as_hidden }}</td><td>{{ field.as_hidden }}</td>
        {% else %}
            <tr><td class="error">{{ field.errors }}</td></tr>
            <td>{{ field.label_tag }}:</td><td> {{ field }}</td>
        {% endif %}
        </tr>
       {% endfor %}
       </table>
        <div align="center" style="margin-top:3ex;">
         <a href="{% url telemeta-collection-detail collection.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
         <a href="#" class="component_icon button icon_save"
   onclick="document.getElementById('_editCollectionForm').submit(); return false;">{% trans "Save" %}</a>
        </div>
      </form>
     </div>
{% endblock infos%}

{% block delete %}
{% endblock %}
