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

{% block head_title %}{% trans "Item" %}- {{ block.super }}{% endblock %}

{% block extra_javascript %}
{% endblock %}

{% block title %}
 <img src="{% url telemeta-images "item.png" %}" alt="item" style="vertical-align:middle" /> Item : NEW
{% endblock %}

{% block title_buttons %}
    {% if user.is_authenticated and perms.telemeta.add_mediaitem %}
    <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
    {% endif %}
{% endblock %}

{% block content %}
  {% block infos %}    
    <div class="infos">
     <form enctype="multipart/form-data" id="_mediaItemCopyForm" method="post" action="">{% csrf_token %}
     <ul>{% for error in form.non_field_errors %}<li class="error">{{ error }}</li>{% endfor %}</ul>
      <table>
       {% for field in form %}
            <tr>
            {% if field.html_name == "copied_from_item" %}
                <td>{{ field.label_tag.as_hidden }}{{ field.as_hidden }}</td>
            {% else %}
                <tr><td class="error">{{ field.errors }}</td></tr>
                <td>{{ field.label_tag }}:</td>
                    {% if field.html_name == "collection" %}
                    <td>&nbsp;{% trans "Title" %} : {{ item.collection.title }}<br />
                        &nbsp;{% trans "Code" %} : {{ item.collection.code }}<br />
                        {{ field }}</td>
                    {% else %}
                    <td>{{ field }}</td>
                    {% endif %}
            {% endif %}
            </tr>
       {% endfor %}
       </table>
       <div align="center" style="margin-top:3ex;">
           <a href="{% url telemeta-item-detail item.public_id %}" class="component_icon button icon_cancel">{% trans "Cancel" %}</a>
         <a href="#" class="component_icon button icon_save"
            onclick="document.getElementById('_mediaItemCopyForm').submit(); return false;">{% trans "Save" %}</a>
       </div>
     </form>
    </div>
  {% endblock infos %}  
{% endblock %}

{% block delete %}
{% endblock %}

