{% load i18n %}

{% with choices.0 as choice %}
    <form method="get" class="admin-numeric-filter-wrapper">
        {% for k, v in choice.request.GET.items %}
            {% if not k == choice.parameter_name|add:'_from' and not k == choice.parameter_name|add:'_to' %}
                <input type="hidden" name="{{ k }}" value="{{ v }}">
            {% endif %}
        {% endfor %}

        <h3>{% blocktrans with filter_title=title %}By {{ filter_title }}{% endblocktrans %}</h3>

        {% if choice.min and choice.max and choice.step %}
            <div class="admin-numeric-filter-slider-tooltips">
                <span class="admin-numeric-filter-slider-tooltip-from">{{ choice.value_from }}</span>
                <span class="admin-numeric-filter-slider-tooltip-to">{{ choice.value_to }}</span>
            </div><!-- /.admin-numeric-filter-slider-tooltips -->

            <div class="admin-numeric-filter-slider" data-min="{{ choice.min }}" data-max="{{ choice.max }}" data-decimals="{{ choice.decimals }}" data-step="{{ choice.step }}">
            </div><!-- /.admin-numeric-filter-slider -->

            <div class="admin-numeric-filter-wrapper-group hidden">
                {{ choice.form.as_p }}
            </div><!-- /.filter-numeric-filter-wrapper-group -->

            <button type="submit" class="submit">{% trans 'Apply' %}</button>
        {% else %}
            <div class="admin-numeric-filter-slider-error">
                <p>
                    {% trans 'No enough data.' %}
                </p>
            </div><!-- /.admin-numeric-filter-slider-error -->
        {% endif %}
    </form>
{% endwith %}