{% if element.person is not null %}
    {% set template = '@ChillPerson/Person/layout.html.twig' %}
    {% set indexPage = 'chill_budget_elements_index' %}
    {% set activeRouteKey = '' %}
    {% set person = element.person %}
    {% set confirm_question = 'Are you sure you want to remove the ressource "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.resource.getName | localize_translatable_string } ) %}
{% else %}
    {% set template = '@ChillPerson/Household/layout.html.twig' %}
    {% set indexPage = 'chill_budget_elements_household_index' %}
    {% set activeRouteKey = '' %}
    {% set household = element.household %}
    {% set confirm_question = 'Are you sure you want to remove the resource "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.resource.getName | localize_translatable_string} ) %}
{% endif %}

{% extends template %}

{% block title  'Remove resource'|trans %}

{% block content %}

{{ include('@ChillMain/Util/confirmation_template.html.twig',
    {
        'title'             : 'Remove resource'|trans,
        'confirm_question'  : confirm_question,
        'cancel_route'      : indexPage,
        'cancel_parameters' : { 'id': person is defined ? person.id : household.id },
        'form'              : delete_form
    } ) }}

{% endblock %}
