improve Budget template

This commit is contained in:
2023-04-25 10:37:41 +00:00
committed by Julien Fastré
parent 9918cf2d58
commit 1d2b6e167f
10 changed files with 81 additions and 123 deletions

View File

@@ -1,5 +1,5 @@
{% macro table_elements(elements, family) %}
<table class="budget-table">
<table class="table table-bordered border-dark budget-table">
<thead>
<tr>
<th class="{{ family }} el-type">{{ 'Budget element type'|trans }}</th>
@@ -13,25 +13,22 @@
{% for f in elements %}
{% set total = total + f.amount %}
<tr>
<td class="column-wide el-type">
<span class="badge-title">
<span class="title_label title_label_{{ family }}"></span>
{% if f.isResource %}
<span class="title_action">{{ f.resource.name|localize_translatable_string }}<span>
{% else %}
<span class="title_action">{{ f.charge.name|localize_translatable_string }}<span>
{% endif %}
</span>
<td class="el-type">
{% if f.isResource %}
{{ f.resource.name|localize_translatable_string }}
{% else %}
{{ f.charge.name|localize_translatable_string }}
{% endif %}
</td>
<td class="column-small">{{ f.amount|format_currency('EUR') }}</td>
<td class="column-wide">
<td>{{ f.amount|format_currency('EUR') }}</td>
<td>
{% if f.endDate is not null %}
{{ f.startDate|format_date('short') ~ ' - ' ~ f.endDate|format_date('short') }}
{% else %}
{{ f.startDate|format_date('short') ~ ' - ...' }}
{{ 'depuis le ' ~ f.startDate|format_date('short') }}
{% endif %}
</td>
<td class="column-small">
<td class="column-fixed">
<ul class="record_actions">
{% if is_granted('CHILL_BUDGET_ELEMENT_SEE', f) %}
<li>
@@ -80,10 +77,9 @@
{% set result = (totalResources - totalCharges) %}
<table>
<table class="table table-bordered border-dark">
<thead>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>{{ 'Budget calculator result'|trans }}</th>
</tr>
@@ -91,7 +87,6 @@
<tbody>
<tr>
<td>{{ 'The balance'|trans }}</td>
<td>&nbsp;</td>
<td>
{{ result|format_currency('EUR') }}
</td>