<form method="get" action="{{ action }}" enctype="application/x-www-form-urlencoded">

    {% if fields|length > 1 %}
        <select name="{{ filterFieldName }}">
            {% for field, label in fields %}
                <option value="{{ field }}"{% if selectedField == field %} selected="selected"{% endif %}>{{ label }}</option>
            {% endfor %}
        </select>
    {% else %}
        <input type="hidden" name="{{ filterFieldName }}" value="{{ fields|keys|first }}" />
    {% endif %}
    {% if params|length > 0 %}
        {% for param, value in params %}
            <input type="hidden" name="{{ param }}" value="{{ value }}"/>
        {% endfor %}
    {% endif %}
    <input type="text" value="{{ selectedValue }}" name="{{ filterValueName }}" />

    <button>{{ options.button }}</button>

</form>
