index templates fixed for display of past and future budgets

This commit is contained in:
Julie Lenaerts 2022-02-25 17:01:24 +01:00
parent 416665f209
commit 274c6115cc
2 changed files with 136 additions and 126 deletions

View File

@ -214,6 +214,82 @@
{% endif %}
</div>
{# {% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', household) %}
<ul class="record_actions sticky-form-buttons">
<li>
<a class="btn btn-create" href="{{ path('chill_budget_resource_household_new', { 'id': household.id} ) }}">{{ 'Create new resource'|trans }}</a>
</li>
<li>
<a class="btn btn-create" href="{{ path('chill_budget_charge_household_new', { 'id': household.id} ) }}">{{ 'Create new charge'|trans }}</a>
</li>
</ul>
{% endif %} #}
{% endif %}
{% if pastCharges|length > 0 or pastResources|length > 0 %}
<h2 class="subtitle">{{ 'Past budget'|trans }}</h2>
<div class="flex-table">
<h3 class="family-title">{{ 'Past resources'|trans }}</h3>
{% if pastResources|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(pastResources, 'resource') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No past resources registered'|trans }}</span>
<div class="item-bloc">
{% endif %}
</div>
<div class="flex-table">
<h3 class="family-title">{{ 'Past charges'|trans }}</h3>
{% if pastCharges|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(pastCharges, 'charge') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No past charges registered'|trans }}</span>
</div>
{% endif %}
</div>
{% endif %}
{% if futureCharges|length > 0 or futureResources|length > 0 %}
<h2 class="subtitle">{{ 'Future budget'|trans }}</h2>
<div class="flex-table">
<h3 class="family-title">{{ 'Future resources'|trans }}</h3>
{% if futureResources|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(futureResources, 'resource') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No future resources registered'|trans }}</span>
</div>
{% endif %}
</div>
<div class="flex-table">
<h3 class="family-title">{{ 'Future charges'|trans }}</h3>
{% if futureCharges|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(futureCharges, 'charge') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No future charges registered'|trans }}</span>
</div>
{% endif %}
</div>
{% endif %}
{% if household.getCurrentMembers|length > 0 %}
<style>
button[aria-expanded="true"] > span.folded,
@ -279,76 +355,6 @@
</div>
</div>
{% endfor %}
{% endif %}
{% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', household) %}
<ul class="record_actions sticky-form-buttons">
<li>
<a class="btn btn-create" href="{{ path('chill_budget_resource_household_new', { 'id': household.id} ) }}">{{ 'Create new resource'|trans }}</a>
</li>
<li>
<a class="btn btn-create" href="{{ path('chill_budget_charge_household_new', { 'id': household.id} ) }}">{{ 'Create new charge'|trans }}</a>
</li>
</ul>
{% endif %}
{% endif %}
{% if pastCharges|length > 0 or pastResources|length > 0 %}
<h2 class="subtitle">{{ 'Past budget'|trans }}</h2>
<h3 class="family-title">{{ 'Past resources'|trans }}</h3>
{% if pastResources|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(pastResources, 'resource') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No past resources registered'|trans }}</span>
<div class="item-bloc">
{% endif %}
<h3 class="family-title">{{ 'Past charges'|trans }}</h3>
{% if pastCharges|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(pastCharges, 'charge') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No past charges registered'|trans }}</span>
</div>
{% endif %}
{% endif %}
{% if futureCharges|length > 0 or futureResources|length > 0 %}
<h2 class="subtitle">{{ 'Future budget'|trans }}</h2>
<h3 class="family-title">{{ 'Future resources'|trans }}</h3>
{% if futureResources|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(futureResources, 'resource') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No future resources registered'|trans }}</span>
</div>
{% endif %}
<h3 class="family-title">{{ 'Future charges'|trans }}</h3>
{% if futureCharges|length > 0 %}
<div class="item-bloc">
{{ m.table_elements(futureCharges, 'charge') }}
</div>
{% else %}
<div class="item-bloc">
<span class="chill-no-data-statement">{{ 'No future charges registered'|trans }}</span>
</div>
{% endif %}
{% endif %}
{% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %}

View File

@ -214,7 +214,7 @@
{% endif %}
</div>
{% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', person) %}
{# {% if is_granted('CHILL_BUDGET_ELEMENT_CREATE', person) %}
<ul class="record_actions sticky-form-buttons">
<li>
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
@ -223,13 +223,13 @@
<a class="btn btn-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
</li>
</ul>
{% endif %}
{% endif %} #}
{% endif %}
{% if pastCharges|length > 0 or pastResources|length > 0 %}
<h2 class="subtitle">{{ 'Past budget'|trans }}</h2>
<div class="flex-table">
<h3 class="family-title">{{ 'Past resources'|trans }}</h3>
{% if pastResources|length > 0 %}
@ -241,7 +241,8 @@
<span class="chill-no-data-statement">{{ 'No past resources registered'|trans }}</span>
<div class="item-bloc">
{% endif %}
</div>
<div class="flex-table">
<h3 class="family-title">{{ 'Past charges'|trans }}</h3>
{% if pastCharges|length > 0 %}
@ -253,11 +254,12 @@
<span class="chill-no-data-statement">{{ 'No past charges registered'|trans }}</span>
</div>
{% endif %}
</div>
{% endif %}
{% if futureCharges|length > 0 or futureResources|length > 0 %}
<h2 class="subtitle">{{ 'Future budget'|trans }}</h2>
<div class="flex-table">
<h3 class="family-title">{{ 'Future resources'|trans }}</h3>
{% if futureResources|length > 0 %}
@ -269,7 +271,8 @@
<span class="chill-no-data-statement">{{ 'No future resources registered'|trans }}</span>
</div>
{% endif %}
</div>
<div class="flex-table">
<h3 class="family-title">{{ 'Future charges'|trans }}</h3>
{% if futureCharges|length > 0 %}
@ -281,6 +284,7 @@
<span class="chill-no-data-statement">{{ 'No future charges registered'|trans }}</span>
</div>
{% endif %}
</div>
{% endif %}
{% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %}