{% load cache %}

{% spaceless %}
{% cache 600 boxform user %}
<form id="rich-object">
{% csrf_token %}
<fieldset style="margin-bottom: 3px">
    <legend>{% trans 'Object type' %}</legend>
    {{ boxform.box_obj_ct }} {{ boxform.box_obj_id }}
</fieldset>

<fieldset id="rich-box-attrs" style="margin-bottom: 3px;">
    <legend>{{ boxform.box_type.label }}</legend>
      {{ boxform.box_type|removetags:"ul li" }}
</fieldset>

<fieldset id="rich-photo-format" style="margin-bottom: 3px; display: none;">
    <legend>{% trans 'Photo attributes' %}</legend>
        {{ boxform.box_photo_size.label }}: {{ boxform.box_photo_size }}
        {{ boxform.box_photo_format.label }}: {{ boxform.box_photo_format }}
    <div class="photo-meta">
        <div style="width: 50%; float: left">
            <label>{{ boxform.box_photo_meta_show_title }} {{ boxform.box_photo_meta_show_title.label }}</label>
            <label>{{ boxform.box_photo_meta_show_authors }} {{ boxform.box_photo_meta_show_authors.label }}</label>
            <label>{{ boxform.box_photo_meta_show_source }} {{ boxform.box_photo_meta_show_source.label }}</label>
        </div>
        <div style="width: 45%; float: left">
            <label>{{ boxform.box_photo_meta_show_description }} {{ boxform.box_photo_meta_show_description.label }}</label>
            <label>{{ boxform.box_photo_meta_show_detail }} {{ boxform.box_photo_meta_show_detail.label }}</label>
        </div>
    </div>
</fieldset>

<fieldset>
    <legend>{{ boxform.box_obj_params.label }}</legend>
    {{ boxform.box_obj_params }}
</fieldset>

<fieldset class="submit-row" style="padding-top: 5px;">
    <div style="float: left">
        <a class="icn btn cancel" onclick="$('#rich-object').trigger('cancel_close');">{% trans 'Cancel' %}</a>
    </div>
    <div style="float: right">
        <a class="icn btn ok def" onclick="$('#rich-object').submit()">{% trans 'Insert box' %}</a>
    </div>
</fieldset>
{% comment %}
    <input type="submit" value="{% trans 'Insert box' %}" />
    <input type="reset" value="{% trans 'Reset' %}" />
    <a class="icn btn ok def">{% trans 'Insert box' %}</a>
    <a class="icn btn cancel">{% trans 'Reset' %}</a>
{% endcomment %}
</form>
{% endcache %}
{% endspaceless %}
