firefly-iii/resources/twig/categories/show.twig
2015-09-25 19:36:03 +02:00

100 lines
4.1 KiB
Twig

{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, category) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'overview'|_ }} (month)</h3>
</div>
<div class="box-body">
{% if Config.get('firefly.chart') == 'google' %}
<div id="month"></div>
{% endif %}
{% if Config.get('firefly.chart') == 'chartjs' %}
<canvas id="month" style="width:100%;height:350px;"></canvas>
{% endif %}
</div>
</div>
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'overview'|_ }} (all)</h3>
</div>
<div class="box-body">
{% if Config.get('firefly.chart') == 'google' %}
<div id="all"></div>
{% endif %}
{% if Config.get('firefly.chart') == 'chartjs' %}
<canvas id="all" style="width:100%;height:350px;"></canvas>
{% endif %}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transactions'|_ }}</h3>
</div>
<div class="box-body no-padding">
{% include 'list/journals' with {showPageSum: true, showTotalSum: true, showPeriodSum: true} %}
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
{% for entry in entries %}
{% if entry[2] != 0 or entry[3] != 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ route('categories.show.date',[category.id,entry[0]]) }}">{{ entry[1] }}</a>
</h3>
</div>
<div class="box-body no-padding">
<table class="table table-hover">
{% if entry[2] != 0 %}
<tr>
<td colspan="33%">{{ 'spent'|_ }}</td>
<td colspan="67%">{{ entry[2]|formatAmount }}</td>
</tr>
{% endif %}
{% if entry[3] != 0 %}
<tr>
<td colspan="33%">{{ 'earned'|_ }}</td>
<td colspan="67%">{{ entry[3]|formatAmount }}</td>
</tr>
{% endif %}
</table>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var categoryID = {{ category.id }};
</script>
<!-- load the libraries and scripts necessary for Google Charts: -->
{% if Config.get('firefly.chart') == 'google' %}
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="js/gcharts.js"></script>
{% endif %}
{% if Config.get('firefly.chart') == 'chartjs' %}
<script type="text/javascript" src="js/Chart.min.js"></script>
<script type="text/javascript" src="js/charts.js"></script>
{% endif %}
<script type="text/javascript" src="js/categories.js"></script>
{% endblock %}