{% load i18n forms %}

<fieldset class="inline tabular-inline {{ class_names|join:' ' }}{% if class %} {{ class }}{% endif %}">
	{% block inline-title %}{% if title %}<legend>{{ title|capfirst }}</legend>{% endif %}{% endblock %}
	{% block above-table %}{% endblock %}
	<table class="form">
		{% if data_list %}
			{% for row in data_list %}
				{% if forloop.first %}
					{% block inline-thead %}
						<thead>
							<tr>
								{% for field_name, field_value in header_list %}
									<th class="field-{{ field_name }}">{{ field_value }}</th>
								{% endfor %}
							</tr>
						</thead>
						<tbody>
					{% endblock %}
				{% endif %}
				<tr class="inline-line {% cycle 'odd' 'even' %}{% if row.class_names %} {{ row.class_names|join:' ' }}{% endif %}{% if form.class_names %} {{ form.class_names|join:' ' }}{% endif %}">
					{% for field_name, field_value in row %}
					<td class="field field-{{ field_name }}">
						{{ field_value }}
					</td>
					{% endfor %}
				</tr>
				{% if forloop.last %}</tbody>{% endif %}
			{% endfor %}
		{% else %}
			<tbody>
				<tr>
					<td class="no-inline-items alert alert-info">
						{{ no_items_text }}
					</td>
				</tr>
			</tbody>
		{% endif %}
	</table>
	{% block below-table %}{% endblock %}
</fieldset>
