Expand code and some refactoring for #595

This commit is contained in:
James Cole
2017-03-18 08:09:14 +01:00
parent edafd16c75
commit 3215c4ee4b
14 changed files with 206 additions and 152 deletions

View File

@@ -40,21 +40,21 @@
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for entry in periods %}
<div class="box {% if entry.date == start %}box-solid box-primary{% endif %}">
{% for period in periods %}
<div class="box {% if period.date == start %}box-solid box-primary{% endif %}">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ route('budgets.no-budget',[entry.string]) }}">{{ entry.name }}</a>
<h3 class="box-title"><a href="{{ route('budgets.no-budget',[period.string]) }}">{{ period.name }}</a>
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
<tr>
<td style="width:33%;">{{ 'transactions'|_ }}</td>
<td style="text-align: right;">{{ entry.count }}</td>
<td style="text-align: right;">{{ period.count }}</td>
</tr>
<tr>
<td style="width:33%;">{{ 'spent'|_ }}</td>
<td style="text-align: right;">{{ entry.sum|formatAmount }}</td>
<td style="text-align: right;">{{ period.sum|formatAmount }}</td>
</tr>
</table>
</div>