{% load combo %}

<h2>Rechercher un bénéficiaire</h2>
<div class="cell--body">
  <form method="get" action="/portail-extranet-rsa/plateforme/{{ plateforme_id }}/recherche-de-beneficiaires/0/">

    <div class="grid-1-1">
      <div class="title"><label>Numéro CAF ou MSA :</label></div>
      <div class="content"><input name="numero_caf" type="text" value="{{ request.GET.numero_caf|default:'' }}" /></div>
    </div>

    <div class="grid-1-1">
      <div class="title"><label>Nom :</label></div>
      <div class="content"><input name="nom" type="text" value="{{ request.GET.nom|default:'' }}" /></div>
    </div>

    <div class="grid-1-1">
      <div class="title"><label>Référent :</label></div>
      <div class="content">
        <select name="referent">
          <option value="" data-hint=""></option>
          {% if json.data and not json.err %}
          {% for r in json.data %}
          {% if r.pers_suivies %}
          <option value="{{ r.id }}" {% if request.GET.referent|decimal == r.id %}selected="selected"{% endif %}>{{ r.nom }} {{ r.prenom }}</option>
          {% endif %}
          {% endfor %}
          {% endif %}
        </select>
      </div>
    </div>

    <div class="grid-1-1">
      <div class="buttons submit"><div class="SubmitWidget widget submit-button ">
        <div class="content"><button name="submit" value="Rechercher">Rechercher</button></div>
      </div>
    </div>

  </form>
</div>
