Refactor period blocks.

This commit is contained in:
James Cole
2018-09-10 20:24:19 +02:00
parent d77112955d
commit efeffaa49f
10 changed files with 207 additions and 167 deletions

View File

@@ -0,0 +1,44 @@
{% for period in periods %}
<div class="box box-default">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ period.route }}">{{ period.title }}</a>
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
{% if period.transactions > 0 %}
<tr>
<td style="width:33%;">{{ 'transactions'|_ }}</td>
<td style="text-align: right;">{{ period.transactions }}</td>
</tr>
{% endif %}
{% for arr in period.spent %}
{% if arr.amount !=0 %}
<tr>
<td style="width:33%;">{{ 'spent'|_ }}</td>
<td style="text-align: right;">{{ formatAmountByCurrency(arr.currency, arr.amount) }}</td>
</tr>
{% endif %}
{% endfor %}
{% for arr in period.earned %}
{% if arr.amount !=0 %}
<tr>
<td style="width:33%;">{{ 'earned'|_ }}</td>
<td style="text-align: right;">{{ formatAmountByCurrency(arr.currency, arr.amount) }}</td>
</tr>
{% endif %}
{% endfor %}
{% for arr in period.transferred %}
{% if arr.amount !=0 %}
<tr>
<td style="width:33%;">{{ 'transferred'|_ }}</td>
<td style="text-align: right;"><span class="text-info">{{ formatAmountByCurrency(arr.currency, arr.amount, false) }}</span></td>
</tr>
{% endif %}
{% endfor %}
</table>
</div>
</div>
{% endfor %}