{% load form_block %} {% load utils %} {% collection_items visible_items form_block as items %} {% block_formset formsets form_block as formset %}
{% with styles=form_block.form.label_class.LabelStyle %} {% with label=labels|get_by_style:styles.VERTICAL %} {% if label %}
{{ label.display_inline }}
{% endif %} {% endwith %} {% if form_block.fixed %}
{% for item in items %} {% item_form formset item as item_form %} {% with field_block=form_block.collection_fields_as_blocks.0 %} {% block_field item_form field_block as field %} {{ field.initial }}{% if not forloop.last %},{% endif %} {% endwith %} {% endfor %}
{% else %} {% if items %}
{% endif %} {% for item in items %} {% item_form formset item as item_form %}
{% with file=item|underscore:'file' type=item|underscore:'file_type' %} {% if form_block.has_file and file %} {% file_thumbnail file as thumbnail %} {% if thumbnail %} {% else %} {% endif %} {% endif %} {% endwith %}
{% for field_block in form_block.collection_fields_as_blocks %}
{% block_field item_form field_block as form_field %} {% with flabels=labels|for_item_field:form_field.name %} {% with label=flabels|closest_label %} {% if form_field.value %} {{ label.text|default:form_field.name }}: {{ form_field.value }} {% else %}   {% endif %} {% endwith %} {% endwith %}
{% empty %}
{{ item|underscore:'filesize'|human_readable }}
{% endfor %} {% if item|underscore:'message' %}
note: {{ item|underscore:'message' }}
{% endif %}
{% endfor %} {% if items %}
{% endif %} {% endif %} {% endwith %}