{% macro render_inline_fields(field, template, render, check=None) %}
<div class="inline-field">
    <div class="inline-field-list">
        {% for subfield in field %}
        <div id="{{ subfield.id }}" class="inline-field">
            {%- if not check or check(subfield) %}
                {% if subfield.get_pk and subfield.get_pk() %}
                <div class="inline-field-control">
                    <input type="checkbox" name="del-{{ subfield.id }}" id="del-{{ subfield.id }}" />
                    <label for="del-{{ subfield.id }}" style="display: inline">{{ _gettext('Delete?') }}</label>
                </div>
                {% else %}
                <div class="inline-field-control">
                    <a href="javascript:void(0)" class="inline-remove-field"><i class="icon-remove"></i></a>
                </div>
                {% endif %}
            {%- endif -%}

            {{ render(subfield) }}
        </div>
        {% endfor %}
    </div>
    <div class="inline-field-template hide">
        {% filter forceescape %}
        <div class="inline-field">
            <div class="inline-field-control">
                <a href="javascript:void(0)" class="inline-remove-field"><i class="icon-remove"></i></a>
            </div>
            {{ render(template) }}
        </div>
        {% endfilter %}
    </div>
    <a id="{{ field.id }}-button" href="javascript:void(0)" class="btn" onclick="faForm.addInlineField(this, '{{ field.id }}');">{{ _gettext('Add') }} {{ field.label.text }}</a>
</div>
{% endmacro %}
