Final code for #595

This commit is contained in:
James Cole
2017-04-23 09:33:33 +02:00
parent 21c24fd7f0
commit 8ef9223d84
10 changed files with 61 additions and 76 deletions

View File

@@ -6,38 +6,29 @@
{% block content %}
<div class="row">
{% if moment != 'all' and moment != '' %}
{% if moment != 'all' %}
{# both charts #}
<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'|_ }} ({{ 'per_period'|_|lower }})</h3>
<h3 class="box-title">
{{ trans('firefly.chart_category_in_period', {name: category.name, start: start.formatLocalized(monthAndDayFormat), end: end.formatLocalized(monthAndDayFormat) }) }}
</h3>
</div>
<div class="box-body">
<canvas id="period-specific-period" style="width:100%" height="350"></canvas>
<canvas id="specific-period" style="width:100%;height:350px;" height="350"></canvas>
</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_periods'|_|lower }})</h3>
<h3 class="box-title">
{{ trans('firefly.chart_category_all', {name: category.name }) }}
</h3>
</div>
<div class="box-body">
<canvas id="all" style="width:100%;" height="350"></canvas>
</div>
</div>
</div>
{% endif %}
{% if moment == '' %}
{# single chart #}
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ subTitle }}</h3>
</div>
<div class="box-body">
<canvas id="period" style="width:100%;height:350px;" height="350"></canvas>
<canvas id="category-everything" style="width:100%;height:350px;" height="350"></canvas>
</div>
</div>
</div>
@@ -47,10 +38,12 @@
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'overview'|_ }} ({{ 'all_periods'|_|lower }})</h3>
<h3 class="box-title">
{{ trans('firefly.chart_category_all', {name: category.name }) }}
</h3>
</div>
<div class="box-body">
<canvas id="all" style="width:100%;" height="350"></canvas>
<canvas id="category-everything" style="width:100%;height:350px;" height="350"></canvas>
</div>
</div>
</div>
@@ -73,7 +66,7 @@
</div>
<div class="box-body">
{% include 'list.journals-tasker' with {hideCategories: true} %}
{% if periods %}
{% if periods.count > 0 %}
<p>
<i class="fa fa-calendar" aria-hidden="true"></i>
<a href="{{ route('categories.show', [category.id,'all']) }}">
@@ -139,7 +132,7 @@
{% block scripts %}
<script type="text/javascript">
var current = '{{ route('chart.category.current', [category.id]) }}';
var all = '{{ route('chart.category.all', [category.id]) }}';
var everything = '{{ route('chart.category.all', [category.id]) }}';
var specific = '{{ route('chart.category.specific', [category.id, start.format('Ymd')]) }}';
</script>
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>