{% load assets %}
{% load bob %}
{% load i18n %}

<form class="form" method="GET" action="">
    {% for fieldset_label, fields in form.fieldsets.items %}
      <h6>{{ fieldset_label }}</h6>
      {% for field in fields.noncollapsed %}
        {% with field=form|get_item:field %}
            {% field_wrapper field %}
        {% endwith %}
      {% endfor %}
      <div class="control-group">
          <a href="#form-collapsed{{forloop.counter}}" data-toggle="collapse" class="btn" style="width:80%"><i class="fugue-icon fugue-ui-accordion"></i>&nbsp;{% trans "More" %} {{ fieldset_label|lower }}...
          </a>
      </div>
      {% if fields.collapsed %}
          <div class="collapse" id="form-collapsed{{forloop.counter}}">
              {% for field in fields.collapsed %}
                {% with field=form|get_item:field %}
                    {% field_wrapper field %}
                {% endwith %}
              {% endfor %}
          </div><hr>
      {% endif %}
    {% endfor %}
    <button type="submit" class="btn btn-primary">
        <i class="fugue-icon fugue-tick"></i>&nbsp;{% trans "Search" %}
    </button>
</form>
