{% extends "@ChillPerson/Person/layout.html.twig" %}

{% set activeRouteKey = '' %}

{% block title %}{{ 'Delete residential address'|trans }}{% endblock %}

{% block content %}
<div class="address-new">

    <h1>{{ block('title') }}</h1>
    {% set a = residentialAddress %}
    <ul class="list-content fa-ul">
        {% if a.hostPerson is not null %}
        <li>
            <i class="fa fa-li fa-home"></i>
            <span class="item-key">{{ "Address of"|trans}} </span>
            <span class="chill-entity entity-person badge-person">{{ a.hostPerson|chill_entity_render_box }}</span>
        </li>
        <li>
            {% set address_date = date(a.startDate|date("m/d/Y")) %}
            {% if a.hostPerson.getCurrentHouseholdAddress(a.endDate) is not null %}
                <i class="fa fa-li fa-map-marker"></i>
                {{ a.hostPerson.getCurrentHouseholdAddress(a.endDate)|chill_entity_render_box }}
            {% endif %}
        </li>
        {% elseif a.hostThirdParty is not null %}
        <li>
            <i class="fa fa-li fa-home"></i>
            <span class="item-key">{{ "Address of"|trans}}</span>
            <span class="chill-entity entity-person badge-person">{{ a.hostThirdParty|chill_entity_render_box }}</span>
        </li>
        <li>
            {% if a.hostThirdParty.address is not null %}
                <i class="fa fa-li fa-map-marker"></i>
                {{ a.hostThirdParty.address|chill_entity_render_box }}
            {% endif %}
        </li>
        {% else %}
        <li>
            {% if a.address is not null %}
                <i class="fa fa-li fa-map-marker"></i>
                {{ a.address|chill_entity_render_box }}
            {% endif %}
            {% endif %}
        </li>
    </ul>

    {{ include('@ChillMain/Util/confirmation_template.html.twig',
        {
            'title'             : 'Delete residential address ?'|trans,
            'confirm_question'  : 'Are you sure you want to remove this residential address for %name% ?'|trans({'%name%': person|chill_entity_render_string }),
            'cancel_route'      : 'chill_person_residential_address_list',
            'cancel_parameters' : {'id' : person.Id},
            'form'              : delete_form
        } ) }}

</div>
{% endblock %}
