Expand view for #780

This commit is contained in:
James Cole
2017-08-30 07:40:39 +02:00
parent 4aaacf8e2e
commit 7702ed027b
4 changed files with 110 additions and 67 deletions

View File

@@ -15,6 +15,7 @@
</div>
{% endif %}
{# list with journals #}
<div class="row">
<div class="{% if periods.count > 0 %}col-lg-10 col-md-10 col-sm-12{% else %}col-lg-12 col-md-12 col-sm-12{% endif %}">
<div class="box">
@@ -22,7 +23,10 @@
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body ">
{# actual list #}
{% include 'list.journals' with {'journals': journals} %}
{# links for other views #}
{% if periods.count > 0 %}
<p>
<i class="fa fa-calendar"></i>
@@ -38,10 +42,13 @@
</div>
</div>
{# boxes with info #}
{% if periods.count > 0 %}
<div class="col-lg-2 col-md-2 col-sm-12 col-xs-12">
{% for period in periods %}
{% if period.count > 0 %}
{% if period.sum != 0 %}
<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('transactions.index',[what, period.string]) }}">{{ period.name }}</a>
@@ -49,29 +56,34 @@
</div>
<div class="box-body no-padding">
<table class="table table-hover">
<tr>
<td style="width:33%;">{{ 'transactions'|_ }}</td>
<td style="text-align: right;">{{ period.count }}</td>
</tr>
{% if what == 'withdrawal' %}
<tbody>
{% for sum in period.sums %}
<tr>
<td style="width:33%;">{{ 'spent'|_ }}</td>
<td style="text-align: right;">{{ period.spent|formatAmount }}</td>
<td style="width:33%;">
{% if what == 'withdrawal' %}
{{ 'spent'|_ }}
{% endif %}
{% if what == 'deposit' %}
{{ 'earned'|_ }}
{% endif %}
{% if what == 'transfers' or what == 'transfer' %}
{{ 'transferred'|_ }}
{% endif %}
</td>
<td style="text-align: right;" title="{{ trans('list.number_of_transactions') }}: {{ sum.count }}">
{% if what == 'transfers' or what == 'transfer' %}
<span class="text-info">
{{ formatAmountBySymbol(Steam.positive(sum.sum), sum.currency.symbol, sum.currency.dp, false) }}
</span>
{% else %}
{{ formatAmountBySymbol(sum.sum, sum.currency.symbol, sum.currency.dp) }}
{% endif %}
</td>
</tr>
{% endif %}
{% if what == 'deposit' %}
<tr>
<td style="width:33%;">{{ 'earned'|_ }}</td>
<td style="text-align: right;">{{ period.earned|formatAmount }}</td>
</tr>
{% endif %}
{% if what == 'transfers' or what == 'transfer' %}
<tr>
<td style="width:33%;">{{ 'transferred'|_ }}</td>
<td style="text-align: right;" class="text-info">{{ period.transferred|formatAmountPlain }}</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}