{% extends "qommon/forms/widgets/nearby-forms.html" %}

{% block demands %}

  {% if global_context.form_var_precision_signalement_raw %}
    {% with demands=form.objects.pending|filter_by:"precision_signalement"|filter_value:global_context.form_var_precision_signalement_raw|distance_filter:distance %}
      {% include "qommon/forms/widgets/includes/nearby-demands.html" %}
    {% endwith %}

  {% elif global_context.form_var_nature_signalement_raw %}
    {% with demands=form.objects.pending|filter_by:"nature_signalement"|filter_value:global_context.form_var_nature_signalement_raw|distance_filter:distance %}
      {% include "qommon/forms/widgets/includes/nearby-demands.html" %}
    {% endwith %}

  {% elif global_context.form_var_categorie_signalement_raw %}
    {% with demands=form.objects.pending|filter_by:"categorie_signalement"|filter_value:global_context.form_var_categorie_signalement_raw|distance_filter:distance %}
      {% include "qommon/forms/widgets/includes/nearby-demands.html" %}
    {% endwith %}

  {% else %}
    {% with demands=form.objects.pending|distance_filter:distance %}
      {% include "qommon/forms/widgets/includes/nearby-demands.html" %}
    {% endwith %}
  {% endif %}
{% endblock %}
