firefly-iii/resources/views/v1/piggy-banks/show.twig
2018-12-21 06:51:21 +01:00

129 lines
5.7 KiB
Twig

{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, piggyBank) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-6">
<div class="box" id="piggyChart">
<div class="box-header with-border">
<h3 class="box-title">{{ 'events'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="piggy-bank-history" style="width:100%;height:400px;" height="400" width="100%"></canvas>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'details'|_ }}</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v"></i></button>
<ul class="dropdown-menu" role="menu">
<li><a href="{{ route('piggy-banks.edit', piggy.id) }}"><i class="fa fa-pencil fa-fw"></i> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('piggy-banks.delete', piggy.id) }}"><i class="fa fa-trash fa-fw"></i> {{ 'delete'|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover" id="piggyDetails">
<tr>
<td style="width:40%;">{{ 'account'|_ }}</td>
<td><a href="{{ route('accounts.show', piggyBank.account_id) }}">{{ piggyBank.account.name }}</a></td>
</tr>
<tr>
<td>{{ 'target_amount'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.target_amount, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
<tr>
<td>{{ 'saved_so_far'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.current_amount, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
<tr>
<td>{{ 'left_to_save'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.left_to_save, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
<tr>
<td>{{ 'start_date'|_ }}</td>
<td>
{% if piggyBank.startdate %}
{{ piggyBank.startdate.formatLocalized(monthAndDayFormat) }}
{% else %}
<em>{{ 'no_start_date'|_ }}</em>
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'target_date'|_ }}</td>
<td>
{% if piggyBank.targetdate %}
{{ piggyBank.targetdate.formatLocalized(monthAndDayFormat) }}
{% else %}
<em>{{ 'no_target_date'|_ }}</em>
{% endif %}
</td>
</tr>
{% if piggyBank.targetdate %}
<tr>
<td>{{ 'suggested_amount'|_ }}</td>
<td>
{{ formatAmountBySymbol(piggy.save_per_month, piggy.currency_symbol, piggy.currency_decimal_places) }}
</td>
</tr>
{% endif %}
</table>
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transactions'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding" id="piggyEvents">
{% include 'list/piggy-bank-events' %}
</div>
</div>
</div>
</div>
{% if piggy.notes %}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ trans('form.notes') }}</h3>
</div>
<div class="box-body markdown">{{ piggy.notes|markdown }}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var piggyBankID = {{ piggyBank.id }};
</script>
<script type="text/javascript" src="v1/js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/ff/charts.defaults.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/ff/charts.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/ff/piggy-banks/show.js?v={{ FF_VERSION }}"></script>
{% endblock %}