firefly-iii/resources/views/budgets/show.twig

111 lines
5.3 KiB
Twig
Raw Normal View History

2015-05-02 02:06:07 -05:00
{% extends "./layout/default.twig" %}
2015-06-19 13:59:14 -05:00
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, budget, repetition) }}
{% endblock %}
2015-05-02 02:06:07 -05:00
{% block content %}
2015-06-27 01:06:24 -05:00
<div class="row">
<div class="col-lg-9 col-md-9 col-sm-7">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'overview'|_ }}</h3>
2015-05-02 02:06:07 -05:00
2015-06-27 01:06:24 -05:00
<!-- ACTIONS MENU -->
<div class="pull-right">
<div class="btn-group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown">
{{ 'actions'|_ }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right" role="menu">
<li><a href="{{ route('budgets.edit',budget.id) }}"><i class="fa fa-pencil fa-fw"></i> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('budgets.delete',budget.id) }}"><i class="fa fa-trash fa-fw"></i> {{ 'delete'|_ }}</a></li>
</ul>
</div>
2015-05-02 02:06:07 -05:00
</div>
</div>
2015-06-27 01:06:24 -05:00
<div class="box-body">
2015-12-18 09:37:02 -06:00
<canvas id="budgetOverview" style="width:100%;height:400px;"></canvas>
2015-06-27 01:06:24 -05:00
</div>
2015-05-02 02:06:07 -05:00
</div>
2015-06-27 01:06:24 -05:00
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'transactions'|_ }}</h3>
</div>
{% include 'list/journals.twig' %}
2015-05-02 02:06:07 -05:00
</div>
</div>
2015-06-27 01:06:24 -05:00
<div class="col-lg-3 col-md-3 col-sm-5">
{% if limits|length == 1 %}
<p class="small text-center"><a href="{{ route('budgets.show',budget.id) }}">{{ 'showEverything'|_ }}</a></p>
{% endif %}
2015-05-02 02:06:07 -05:00
2015-06-27 01:06:24 -05:00
{% for limit in limits %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title"><a href="{{ route('budgets.show',[budget.id,limit.id]) }}">{{ limit.startdate.formatLocalized(monthFormat) }}</a>
</h3>
</div>
<div class="box-body">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
{{ 'amount'|_ }}: {{ limit.amount|formatAmount }}
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
{{ 'spent'|_ }}: {{ limit.spent|formatAmount }}
2015-06-27 01:06:24 -05:00
</div>
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
{% set overspent = limit.amount + limit.spent < 0 %}
2015-10-03 15:29:34 -05:00
{% if overspent %}
{% set pct = (limit.spent != 0 ? (limit.amount / (limit.spent*-1))*100 : 0) %} <!-- must have -1 here -->
<div class="progress progress-striped">
<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="{{ pct|round }}" aria-valuemin="0"
aria-valuemax="100" style="width: {{ pct|round }}%;"></div>
<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="{{ (100-pct)|round }}"
aria-valuemin="0" aria-valuemax="100" style="width: {{ (100-pct)|round }}%;"></div>
</div>
{% else %}
{% set pct = (limit.amount != 0 ? (((limit.spent*-1) / limit.amount)*100) : 0) %} <!-- must have -1 here -->
<div class="progress progress-striped">
<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="{{ pct|round }}" aria-valuemin="0"
aria-valuemax="100" style="width: {{ pct|round }}%;"></div>
</div>
{% endif %}
2015-05-02 02:06:07 -05:00
</div>
</div>
</div>
</div>
2015-05-02 02:06:07 -05:00
{% endfor %}
2015-06-27 01:06:24 -05:00
{% if limits|length == 1 %}
<p class="small text-center"><a href="{{ route('budgets.show',budget.id) }}">{{ 'showEverything'|_ }}</a></p>
{% endif %}
2015-05-02 02:06:07 -05:00
2015-06-27 01:06:24 -05:00
</div>
2015-05-02 02:06:07 -05:00
</div>
{% endblock %}
{% block scripts %}
2015-06-27 01:06:24 -05:00
<script type="text/javascript">
2015-12-18 09:37:45 -06:00
var budgetID = {{ budget.id }};
2015-06-27 01:06:24 -05:00
{% if repetition.id %}
2015-12-18 09:37:45 -06:00
var repetitionID = {{ repetition.id }};
var year = {{ repetition.startdate.format('Y') }};
2015-06-27 01:06:24 -05:00
{% else %}
2015-12-18 09:37:45 -06:00
var year = {{ Session.get('start').format('Y') }};
2015-06-27 01:06:24 -05:00
{% endif %}
2015-05-02 02:06:07 -05:00
2015-06-27 01:06:24 -05:00
</script>
2015-05-02 02:06:07 -05:00
2015-12-18 09:37:02 -06:00
<script type="text/javascript" src="js/Chart.min.js"></script>
<script type="text/javascript" src="js/charts.js"></script>
2015-06-27 01:06:24 -05:00
<script type="text/javascript" src="js/budgets.js"></script>
2015-05-02 02:06:07 -05:00
{% endblock %}