{% set ns = namespace(people={}) %}
{% for person in project.ancestry['person'] %}
    {% if person.public %}
        {% set person_label = person.label | localize %}
    {% else %}
        {% set person_label = _('private') %}
    {% endif %}
    {% do ns.people.update({
        person.id: {
            'id': person.id,
            'label': person_label,
            'url': person | url,
            'parentIds': person.parents | map(attribute='id') | list,
            'childIds': person.children | map(attribute='id') | list,
            'private': person.private,
        }
    }) %}
{% endfor %}
{{ ns.people | json | safe }}
