templates adjusted to allow use for person and household

This commit is contained in:
2022-02-24 15:45:35 +01:00
parent c546d23421
commit 81b42ef99a
10 changed files with 430 additions and 64 deletions

View File

@@ -1,18 +1,29 @@
{% extends "@ChillPerson/Person/layout.html.twig" %}
{% 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 charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('charge') } ) %}
{% 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 charge "%type%" associated to household "%household%" ?'|trans({ '%household%' : household.id, '%type%': element.type|budget_element_type_display('charge') } ) %}
{% endif %}
{% set activeRouteKey = '' %}
{% set person = element.person %}
{% extends template %}
{% block title 'Remove resource'|trans %}
{% block title 'Remove charge'|trans %}
{% block personcontent %}
{% block content %}
{{ include('ChillMainBundle:Util:confirmation_template.html.twig',
{
'title' : 'Remove charge'|trans,
'confirm_question' : 'Are you sure you want to remove the charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('charge') } ),
'cancel_route' : 'chill_budget_elements_index',
'cancel_parameters' : { 'id' : element.person.id },
'confirm_question' : confirm_question,
'cancel_route' : indexPage,
'cancel_parameters' : { 'id': person is defined ? person.id : household.id },
'form' : delete_form
} ) }}