{% load styled_forms %}

{% if file_formset.total_form_count > 0 %}
    <input type="submit" value="Update Files" />
    <h2>Files</h2>
{% endif %}
{{ file_formset.management_form }}
{% for file_form in file_formset.forms %}
    {% if not forloop.first %}
        <hr/>
    {% endif %}
    <div class="edit-wrap">
        {{ file_form.id }}
        <div class="icon"><img src="{{ file_form.instance.icon }}" /></div>
        <div class="file"><a href="{{ file_form.instance.file.url }}">{{ file_form.instance.basename }}</a></div>
        
        {% for error in file_form.errors %}
            <li><strong>{{ error|escape }}</strong></li>
        {% endfor %}
        
        {{ file_form|styled_form }}
    </div>
{% endfor %}
