{% load i18n widget_tweaks %}
{% csrf_token %}
{% for field in form %}
	{% if field.errors %}
		<div class="form-group has-error">
			<label class="control-label" for="id_{{ field.name }}">{{ field.label }}</label>
			{{ field|attr:"class:form-control" }}
			<span class="help-block">
				{% for error in  field.errors %}{{ error }}{% endfor %}
			</span>
		</div>
	{% else %}
		<div class="form-group">
			<label class="control-label" for="id_{{ field.name }}">{{ field.label }}</label>
			{{ field|attr:"class:form-control" }}
			{% if field.help_text %}
				<p class="help-block"><small>{{ field.help_text }}</small></p>
			{% endif %}
		</div>
	{% endif %}
{% endfor %}