Restored some cache [skip ci]

This commit is contained in:
James Cole 2015-06-27 22:22:27 +02:00
parent 2c2ed26c38
commit 4673170531
10 changed files with 19 additions and 26 deletions

View File

@ -33,13 +33,9 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
], ],
]; ];
// language:
$language = Preferences::get('language', 'en')->data;
$format = Config::get('firefly.month.' . $language);
/** @var array $entry */ /** @var array $entry */
foreach ($entries as $entry) { foreach ($entries as $entry) {
$data['labels'][] = $entry[0]->formatLocalized($format); $data['labels'][] = trans('firefly.spent');
$data['datasets'][0]['data'][] = $entry[1]; $data['datasets'][0]['data'][] = $entry[1];
} }

View File

@ -22,10 +22,6 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
*/ */
public function all(Collection $entries) public function all(Collection $entries)
{ {
// language:
$language = Preferences::get('language', 'en')->data;
$format = Config::get('firefly.month.' . $language);
$data = [ $data = [
'count' => 1, 'count' => 1,
'labels' => [], 'labels' => [],
@ -38,7 +34,7 @@ class ChartJsCategoryChartGenerator implements CategoryChartGenerator
]; ];
foreach ($entries as $entry) { foreach ($entries as $entry) {
$data['labels'][] = $entry[0]->formatLocalized($format); $data['labels'][] = trans('firefly.spent');
$data['datasets'][0]['data'][] = round($entry[1], 2); $data['datasets'][0]['data'][] = round($entry[1], 2);
} }

View File

@ -101,7 +101,7 @@ class AccountController extends Controller
$cache->addProperty('frontpage'); $cache->addProperty('frontpage');
$cache->addProperty('accounts'); $cache->addProperty('accounts');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$data = $this->generator->frontpage($accounts, $start, $end); $data = $this->generator->frontpage($accounts, $start, $end);
@ -133,7 +133,7 @@ class AccountController extends Controller
$cache->addProperty('single'); $cache->addProperty('single');
$cache->addProperty($account->id); $cache->addProperty($account->id);
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$data = $this->generator->single($account, $start, $end); $data = $this->generator->single($account, $start, $end);

View File

@ -57,7 +57,7 @@ class BillController extends Controller
$cache->addProperty('bills'); $cache->addProperty('bills');
$cache->addProperty('frontpage'); $cache->addProperty('frontpage');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$bills = $repository->getActiveBills(); $bills = $repository->getActiveBills();

View File

@ -60,7 +60,7 @@ class BudgetController extends Controller
$cache->addProperty($last); $cache->addProperty($last);
$cache->addProperty('budget'); $cache->addProperty('budget');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$entries = new Collection; $entries = new Collection;
@ -105,7 +105,7 @@ class BudgetController extends Controller
$cache->addProperty($budget->id); $cache->addProperty($budget->id);
$cache->addProperty($repetition->id); $cache->addProperty($repetition->id);
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$entries = new Collection; $entries = new Collection;
@ -149,7 +149,7 @@ class BudgetController extends Controller
$cache->addProperty('budget'); $cache->addProperty('budget');
$cache->addProperty('all'); $cache->addProperty('all');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
bcscale(2); bcscale(2);
@ -215,7 +215,7 @@ class BudgetController extends Controller
$cache->addProperty('budget'); $cache->addProperty('budget');
$cache->addProperty('year'); $cache->addProperty('year');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$entries = new Collection; $entries = new Collection;

View File

@ -62,7 +62,7 @@ class CategoryController extends Controller
$cache->addProperty('all'); $cache->addProperty('all');
$cache->addProperty('categories'); $cache->addProperty('categories');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
while ($start <= $end) { while ($start <= $end) {
@ -101,7 +101,7 @@ class CategoryController extends Controller
$cache->addProperty('category'); $cache->addProperty('category');
$cache->addProperty('frontpage'); $cache->addProperty('frontpage');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$array = $repository->getCategoriesAndExpensesCorrected($start, $end); $array = $repository->getCategoriesAndExpensesCorrected($start, $end);
@ -184,7 +184,7 @@ class CategoryController extends Controller
$cache->addProperty('category'); $cache->addProperty('category');
$cache->addProperty('year'); $cache->addProperty('year');
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$shared = $shared == 'shared' ? true : false; $shared = $shared == 'shared' ? true : false;

View File

@ -47,7 +47,7 @@ class PiggyBankController extends Controller
$cache->addProperty('piggy-history'); $cache->addProperty('piggy-history');
$cache->addProperty($piggyBank->id); $cache->addProperty($piggyBank->id);
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
/** @var Collection $set */ /** @var Collection $set */

View File

@ -55,7 +55,7 @@ class ReportController extends Controller
$cache->addProperty($year); $cache->addProperty($year);
$cache->addProperty($shared); $cache->addProperty($shared);
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$entries = new Collection; $entries = new Collection;
@ -95,7 +95,7 @@ class ReportController extends Controller
$cache->addProperty($year); $cache->addProperty($year);
$cache->addProperty($shared); $cache->addProperty($shared);
if ($cache->has()) { if ($cache->has()) {
//return Response::json($cache->get()); // @codeCoverageIgnore return Response::json($cache->get()); // @codeCoverageIgnore
} }
$start = new Carbon($year . '-01-01'); $start = new Carbon($year . '-01-01');

View File

@ -86,7 +86,7 @@ var defaultLineOptions = {
responsive: true, responsive: true,
scaleLabel: "<%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>", scaleLabel: "<%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>",
tooltipFillColor: "rgba(0,0,0,0.5)", tooltipFillColor: "rgba(0,0,0,0.5)",
multiTooltipTemplate: "<%=datasetLabel%>: <%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>" tooltipTemplate: "<%if (label){%><%=label%>: <%}%>" + currencySymbol + " <%= value %>",
}; };
var defaultColumnOptions = { var defaultColumnOptions = {
@ -100,6 +100,7 @@ var defaultColumnOptions = {
scaleLabel: "<%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>", scaleLabel: "<%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>",
tooltipFillColor: "rgba(0,0,0,0.5)", tooltipFillColor: "rgba(0,0,0,0.5)",
tooltipTemplate: "<%if (label){%><%=label%>: <%}%>" + currencySymbol + " <%= value %>", tooltipTemplate: "<%if (label){%><%=label%>: <%}%>" + currencySymbol + " <%= value %>",
multiTooltipTemplate: "<%=datasetLabel%>: "+currencySymbol+" <%= Number(value).toFixed(2).replace('.', ',') %>"
}; };
var defaultStackedColumnOptions = { var defaultStackedColumnOptions = {
@ -112,7 +113,7 @@ var defaultStackedColumnOptions = {
responsive: true, responsive: true,
scaleLabel: "<%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>", scaleLabel: "<%= '" + currencySymbol + " ' + Number(value).toFixed(2).replace('.', ',') %>",
tooltipFillColor: "rgba(0,0,0,0.5)", tooltipFillColor: "rgba(0,0,0,0.5)",
multiTooltipTemplate: currencySymbol + " <%= Number(value).toFixed(2).replace('.', ',') %>" multiTooltipTemplate: "<%=datasetLabel%>: "+currencySymbol+" <%= Number(value).toFixed(2).replace('.', ',') %>"
}; };

View File

@ -32,7 +32,7 @@
<div id="income-expenses-sum-chart"></div> <div id="income-expenses-sum-chart"></div>
{% endif %} {% endif %}
{% if Config.get('firefly.chart') == 'chartjs' %} {% if Config.get('firefly.chart') == 'chartjs' %}
<canvas id="income-expenses-sum-chart" style="width:300px;height:400px;"></canvas> <canvas id="income-expenses-sum-chart" style="width:100%;height:400px;"></canvas>
{% endif %} {% endif %}
</div> </div>
</div> </div>