{% load i18n admin_static admin_modify %}
{{ inline_admin_formset.formset.management_form }}
<div class="row-fluid">
    <div class="span12">
		<h3>{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}</h3>
		{{ inline_admin_formset.formset.non_form_errors }}
		<table id="results" class="table table-striped table-bordered">
			<thead><tr>
				{% for field in inline_admin_formset.fields %}
					{% if not field.widget.is_hidden %}
						<th{% if field.required %} class="required"{% endif %}>{{ field.label|capfirst }}
						    {% if field.help_text %}&nbsp;<img src="{% static "admin/img/icon-unknown.gif" %}" class="help help-tooltip" width="10" height="10" alt="({{ field.help_text|striptags }})" title="{{ field.help_text|striptags }}" />{% endif %}
						</th>
                    {% endif %}
				{% endfor %}
				{% if inline_admin_formset.formset.can_delete %}<th>{% trans "Delete?" %}</th>{% endif %}
			</tr></thead>
			<tbody>
				{% for inline_admin_form in inline_admin_formset %}
					{% include 'ajax_forms/edit_inline/tabular_row.html' %}
				{% endfor %}
            </tbody>
		</table>
    </div>
</div>
<script type="text/javascript">
(function($) {
  $("#{{ inline_admin_formset.formset.prefix }}-group .tabular.inline-related tbody tr").tabularFormset({
    prefix: "{{ inline_admin_formset.formset.prefix }}",
    adminStaticPrefix: '{% static "admin/" %}',
    addText: "{% blocktrans with inline_admin_formset.opts.verbose_name|title as verbose_name %}Add another {{ verbose_name }}{% endblocktrans %}",
    deleteText: "{% trans 'Remove' %}"
  });
})(django.jQuery);
</script>
