{% load i18n admin_static admin_modify slick_tags %}

<div id='{{ inline_admin_formset.formset.prefix }}-group' class='inline-group'>
	<div class='tabular inline-related {% if forloop.last %}last-related{% endif %}'>
		{{ inline_admin_formset.formset.management_form }}

		<div class='panel panel-inverse'>
			<div class='panel-heading'>
				{{ inline_admin_formset.opts.verbose_name_plural|capfirst }}
			</div>
			<div class='panel-body'>
				<table class='table table-striped'>
					<thead>
						<tr>
							{% for field in inline_admin_formset.fields %}
								{% if not field.widget.is_hidden %}
									<th>
										{{ field.label|capfirst }}

									</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 %}
							{% if inline_admin_form.form.non_field_errors %}
								<tr class='danger'>
									<td colspan='{{ inline_admin_form|cell_count }}'>
										{{ inline_admin_form.form.non_field_errors }}
									</td>
								</tr>
							{% endif %}
							<tr id='{{ inline_admin_formset.formset.prefix }}-{% if not forloop.last %}{{ forloop.counter0 }}{% else %}empty{% endif %}' class='form-row'>
								<td class='original hidden'>
									{% if inline_admin_form.original or inline_admin_form.show_url %}
										<p>
											{% if inline_admin_form.original %}
												{{ inline_admin_form.original }}
											{% endif %}
											{% if inline_admin_form.show_url %}
												<a href='{% url 'admin:view_on_site' inline_admin_form.original_content_type_id inline_admin_form.original.pk %}'>
													{% trans "View on site" %}

												</a>
											{% endif %}
										</p>
									{% endif %}
									{% if inline_admin_form.needs_explicit_pk_field or inline_admin_form.has_auto_field %}
										{{ inline_admin_form.pk_field.field }}

									{% endif %}
									{{ inline_admin_form.fk_field.field }}

									{% spaceless %}
										{% for fieldset in inline_admin_form %}
											{% for line in fieldset %}
												{% for field in line %}
													{% if field.is_hidden %}
														{{ field.field }}

													{% endif %}
												{% endfor %}
											{% endfor %}
										{% endfor %}
									{% endspaceless %}
								</td>
								{% for fieldset in inline_admin_form %}
									{% for line in fieldset %}
										{% for field in line %}
											<td class='{% if field.field.name %}field-{{ field.field.name }}{% endif %}'>
												{% if field.is_readonly %}
													<p>{{ field.contents|linebreaksbr }}</p>
												{% else %}
													{% slick_field field show_label=False %}

												{% endif %}
											</td>
										{% endfor %}
									{% endfor %}
								{% endfor %}
								{% if inline_admin_formset.formset.can_delete %}
									<td>
										{% if inline_admin_form.original %}

												{{ inline_admin_form.deletion_field.field }}


										{% endif %}

									</td>
								{% endif %}
							</tr>
						{% endfor %}
					</tbody>
				</table>
			</div>
		</div>
	</div>
</div>
<hr />
