{% load combo %}

{% if json.data %}
{% with user=json.data %}

{% include "rsu/identite-mini.html" with user=user %}

{% if request.GET.rsu_adult %}
<p>
{% if not user.union %}
<a class="mini-ts" href="{{ eservices_url }}backoffice/submission/declaration-d-une-union-bo/?session_var_rsu_adult={{ request.GET.rsu_adult }}&session_var_rsu_spoose={{ user.id }}&cancelurl={{ portal_agent_url }}">Déclarer cette union</a>
{% else %}
<strong>Déjà en union</strong> avec
  {{ user.union.nom_de_naissance }}
  {% if user.union.nom_d_usage %}({{ user.union.nom_d_usage }}){% endif %}
  {{ user.union.prenoms }} <a href="/?rsu_adult={{ user.union.id }}">#{{ user.union.id }}</a>
  <br />
{% endif %}
<a class="mini-ts" href="?{% if request.GET.rsu_adult %}rsu_adult={{ request.GET.rsu_adult }}&{% endif %}{% if request.GET.rsu_child %}rsu_child={{ request.GET.rsu_child }}{% endif %}">Autre recherche</a>
</p>
{% endif %}

{% if user.enfants %}
<div class="newline grid-1-1">
<h3>Enfants</h3>
</div>
{% for user in user.enfants|dictsort:"date_de_naissance" %}
<div class="newline grid-1-1">
{% include "rsu/identite-mini.html" with user=user %}
</div>
{% endfor %}
{% endif %}

<div class="newline grid-1-1">
<p><!-- un peu d'espace -->&nbsp;</p>
</div>

<script>
$(function() {
  $('div.searchcell.rsu-spoose').hide();
  $('aside#sidebar div.rsu-child').hide();
});
</script>

{% endwith %}
{% else %}

<p>
Pour ajouter un conjoint à l’individu affiché ci-contre, utiliser la recherche ci-dessus.
</p>

{% endif %}
