mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-01 10:59:45 +00:00
templates adjusted to allow use for person and household
This commit is contained in:
@@ -1,12 +1,22 @@
|
||||
{% 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 title = 'Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% else %}
|
||||
{% set template = '@ChillPerson/Household/layout.html.twig' %}
|
||||
{% set indexPage = 'chill_budget_elements_household_index' %}
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set household = element.household %}
|
||||
{% set title = 'Charge for household %household%'|trans({ '%household%' : household.id } ) %}
|
||||
{% endif %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set person = element.person %}
|
||||
{% set title = 'Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% extends template %}
|
||||
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="budget-show">
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
@@ -48,11 +58,11 @@
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="btn btn-cancel">
|
||||
<a href="{{ path(indexPage, { 'id': person is defined ? person.id : household.id } ) }}" class="btn btn-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
|
||||
{% if is_granted('CHILL_BUDGET_ELEMENT_UPDATE', element) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_budget_charge_edit', { 'id': element.id } ) }}" class="btn btn-edit">{{ 'Edit'|trans }}</a>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user