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

@@ -134,32 +134,7 @@
</div>
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-4 col-sm-12 col-xs-12">
{% for period in periods %}
{% if (period.spent != 0 or period.earned != 0) %}
<div class="box {% if period.date == end %}box-solid box-primary{% endif %}">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ route('accounts.show',[account.id,period.start,period.end]) }}">{{ period.name }}</a>
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
{% if period.spent != 0 %}
<tr>
<td style="width:33%;">{{ 'spent'|_ }}</td>
<td style="text-align: right;">{{ formatAmountByCurrency(currency, period.spent) }}</td>
</tr>
{% endif %}
{% if period.earned != 0 %}
<tr>
<td style="width: 33%;">{{ 'earned'|_ }}</td>
<td style="text-align: right;">{{ formatAmountByCurrency(currency, period.earned) }}</td>
</tr>
{% endif %}
</table>
</div>
</div>
{% endif %}
{% endfor %}
{% include 'list.periods' %}
</div>
{% endif %}
</div>