firefly-iii/resources/views/piggy-banks/show.twig
2018-01-12 20:37:56 +01:00

121 lines
5.3 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', piggyBank.id) }}"><i class="fa fa-pencil fa-fw"></i> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('piggy-banks.delete', piggyBank.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>{{ piggyBank.targetamount|formatAmount }}</td>
</tr>
<tr>
<td>{{ 'saved_so_far'|_ }}</td>
<td>{{ currentRelevantRepAmount(piggyBank)|formatAmount }}</td>
</tr>
<tr>
<td>{{ 'left_to_save'|_ }}</td>
<td>{{ (piggyBank.targetamount - currentRelevantRepAmount(piggyBank))|formatAmount }}</td>
</tr>
<tr>
<td>{{ 'start_date'|_ }}</td>
<td>
{% if piggyBank.startdate %}
{{ piggyBank.startdate.format('jS F Y') }}
{% else %}
<em>{{ 'no_start_date'|_ }}</em>
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'target_date'|_ }}</td>
<td>
{% if piggyBank.targetdate %}
{{ piggyBank.targetdate.format('jS F Y') }}
{% else %}
<em>{{ 'no_target_date'|_ }}</em>
{% endif %}
</td>
</tr>
{% if piggyBank.targetdate %}
<tr>
<td>{{ 'suggested_amount'|_ }}</td>
<td>
{{ suggestedMonthlyAmount(piggyBank)|formatAmount }}
</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 note %}
<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">{{ note.text|markdown }}
</div>
</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var piggyBankID = {{ piggyBank.id }};
</script>
<script type="text/javascript" src="js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/charts.defaults.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/charts.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/piggy-banks/show.js?v={{ FF_VERSION }}"></script>
{% endblock %}