{% extends "mapentity/base.html" %}
{% load i18n crispy_forms_tags %}
{% load attachments_tags %}

{% block extrahead %}
    {{ block.super }}
    {{ form.media }}
{% endblock extrahead %}

{% block nav-detail %}active{% endblock nav-detail %}

{% block mainpanel %}
    <div class="span12">
        <h1>{{ title }}
        {% if object %}
            <a class="btn btn-danger" href="{{ object.get_delete_url }}">{% trans "Delete" %}</a>
        {% endif %}</h1>
        
        <div>&nbsp;</div>
        
        {% crispy form %}

        <div style="clear:both"></div>

        <div class="file-attachment span6">
            <h3>{% trans "File attachments" %}</h3>
            <div class="file-attachment-update">
                <h4>{% trans "New file attachment" %}</h4>
                {% attachment_form object %}
            </div>

            <div class="file-attachment file-attachment-detail">
                <h4>{% trans "Existing file attachment" %}</h4>
                {% with object=object attachment_delete_next=object.get_detail_url %}
                    {% include 'paperclip/details.html' %}
                {% endwith %}
            </div>
        </div>

    </div>
{% endblock mainpanel %}

{% block extrabody %}
    {{ block.super }}
    <script type="text/javascript">
        $('#button-id-cancel').click(function (){ window.location = '{{ object.get_list_url }}';});
    </script>
{% endblock extrabody %}

{% extends "mapentity/base.html" %}
{% load i18n crispy_forms_tags %}
{% load attachments_tags %}

{% block extrahead %}
    {{ block.super }}
    {{ form.media }}
{% endblock extrahead %}

{% block nav-detail %}active{% endblock nav-detail %}

{% block mainpanel %}
    <div class="span12">
        <h1>{{ title }}
        {% if object %}
            <a class="btn btn-danger" href="{{ object.get_delete_url }}">{% trans "Delete" %}</a>
        {% endif %}</h1>
        
        <div>&nbsp;</div>
        
        {% crispy form %}

        <div style="clear:both"></div>

        {% if object.pk %}
        <div class="file-attachment span6">
            <h3>{% trans "File attachments" %}</h3>
            <div class="file-attachment-update">
                <h4>{% trans "New file attachment" %}</h4>
                {% attachment_form object %}
            </div>

            <div class="file-attachment file-attachment-detail">
                <h4>{% trans "Existing file attachment" %}</h4>
                {% with object=object attachment_delete_next=object.get_detail_url %}
                    {% include 'paperclip/details.html' %}
                {% endwith %}
            </div>
        </div>
        {% endif %}

    </div>
{% endblock mainpanel %}

{% block extrabody %}
    {{ block.super }}
    <script type="text/javascript">
        $('#button-id-cancel').click(function (){ window.location = '{{ object.get_list_url }}';});
    </script>
{% endblock extrabody %}

Add file only on entity update
Add file only on entity update
