<form
    class="form {{ css_class }}"
    method="{{ method.upper }}"
{% if form.is_multipart %}
    enctype="multipart/form-data"
{% endif %}
    action="{{ action }}">
{% if method.upper == "POST" %}
{%   csrf_token %}
{% endif %}
{% for f in form %}
<div class="control-group{% if f.errors %} error{% endif %}">
    <label class="control-label" for="{{f.name}}">{{ f.label }}</label>
    <div class="controls">
        {{ f }}
        {% if f.errors %}
        <span class="help-block">
            {% for e in f.errors %}{{ e }}{% endfor %}
        </span>
        {% else %}
        {%   if f.help_text %}
        <span class="help-block">
            {{ f.help_text }}
        </span>
        {%   endif %}
        {% endif %}
    </div>
</div>
{% endfor %}
<div class="form-actions">
    {% spaceless %}
    <button type="submit" class="btn btn-primary"><i
        {% if fugueicons %}
        class="fugue-icon fugue-tick"
        {% else %}
        class="icon-ok icon-white"
        {% endif %}
    ></i>&nbsp;Save</button>
    {% endspaceless %}
</div>
</form>
