{# * Copyright (C) 2014, Champs Libres Cooperative SCRLFS, * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . #} {% extends "@ChillMain/layout.html.twig" %} {% block title %}{{ 'Add a person'|trans }}{% endblock title %} {% macro button_person_after(person) %} {% set household = person.getCurrentHousehold %} {% if household is not null %}
  • {% endif %} {% endmacro %} {% block content %}

    {{ 'Add a person'|trans }}

    {% if alternatePersons is not empty %}
    {% transchoice alternatePersons|length with { '%nb%': alternatePersons|length } %} %nb% person with similar name. Please verify that this is a new person {% endtranschoice %}
    {% for person in alternatePersons %}
    {{ person|chill_entity_render_box({ 'render': 'bloc', 'addLink': true, 'addInfo': true, 'addAge': true, 'addAltNames': true, 'addCenter': true, 'address_multiline': false, 'customButtons': { 'after': _self.button_person_after(person) } }) }}
    {% endfor %}
    {% endif %} {{ form_start(form, {'attr' : {'id' : 'create-form'}}) }}
    {{ form_label(form.lastName, 'Last name'|trans) }}
    {{ form_widget(form.lastName, {'attr': {'data-suggest-transform': 'uppercase_all' } }) }}
    {{ form_label(form.firstName, 'First name'|trans) }}
    {{ form_widget(form.firstName, {'attr': {'data-suggest-transform': 'uppercase_first_letter' } }) }}
    {% if form.altNames is defined %} {% for altName in form.altNames %}
    {{ form_label(altName) }}
    {{ form_widget(altName, {'attr': {'data-suggest-transform': 'uppercase_all' } }) }}
    {% endfor %} {% endif %} {{ form_row(form.gender, { 'label' : 'Gender'|trans }) }} {{ form_row(form.birthdate, { 'label' : 'Date of birth'|trans }) }} {{ form_row(form.phonenumber, { 'label' : 'Phonenumber'|trans }) }} {{ form_row(form.mobilenumber, { 'label' : 'Mobilenumber'|trans }) }} {{ form_row(form.email, { 'label' : 'Email'|trans }) }} {% if form.center is defined %} {{ form_row(form.center) }} {% endif %}
    {{ form_end(form) }}
    {% endblock content %} {% block js %} {{ encore_entry_script_tags('page_suggest_names') }} {% endblock js %}