Move some stuff over to AJAX thing.

This commit is contained in:
James Cole
2016-10-25 18:53:54 +02:00
parent e2d187d74b
commit a7e5fcc806
20 changed files with 164 additions and 247 deletions

View File

@@ -192,6 +192,9 @@
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep|escape('js') }}";
var frac_digits = {{ localeconv.frac_digits }};
var showFullList = '{{ trans('firefly.show_full_list') }}';
var showOnlyTop = '{{ trans('firefly.show_only_top',{number:listLength}) }}';
</script>

View File

@@ -22,18 +22,13 @@
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- income -->
{% include 'reports/partials/income.twig' %}
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- expenses -->
{% include 'reports/partials/expenses.twig' %}
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport">
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
{% include 'reports/partials/income-vs-expenses.twig' %}
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="incomeVsExpenseReport">
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
{% include 'reports/partials/tags.twig' %}
@@ -84,17 +79,9 @@
var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}';
var incomeTopLength = {{ incomeTopLength }};
var expenseTopLength = {{ expenseTopLength }};
var incomeRestShow = false; // starts hidden.
var expenseRestShow = false; // starts hidden.
var showTheRest = '{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}';
var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}';
var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}';
var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}';
<!-- some URL's -->
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
</script>
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
<script type="text/javascript" src="js/ff/reports/default/month.js"></script>

View File

@@ -33,18 +33,13 @@
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="accountReport">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- income -->
{% include 'reports/partials/income.twig' %}
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<!-- expenses -->
{% include 'reports/partials/expenses.twig' %}
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport">
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
{% include 'reports/partials/income-vs-expenses.twig' %}
<div class="col-lg-6 col-md-6 col-sm-6 loading" id="incomeVsExpenseReport">
</div>
<div class="col-lg-6 col-md-6 col-sm-6">
{% include 'reports/partials/tags.twig' %}
@@ -165,17 +160,9 @@
var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}';
var incomeTopLength = {{ incomeTopLength }};
var expenseTopLength = {{ expenseTopLength }};
var incomeRestShow = false; // starts hidden.
var expenseRestShow = false; // starts hidden.
var showTheRest = '{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}';
var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}';
var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}';
var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}';
<!-- some URL's -->
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
</script>
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>

View File

@@ -33,14 +33,12 @@
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="loading" id="accountReport">
</div>
{% include 'reports/partials/income-vs-expenses.twig' %}
<div class="loading" id="incomeVsExpenseReport">
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
{% include 'reports/partials/income.twig' %}
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
{% include 'reports/partials/expenses.twig' %}
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="incomeReport">
</div>
<div class="col-lg-3 col-md-3 col-sm-3 loading" id="expenseReport">
</div>
</div>
<div class="row">
@@ -125,18 +123,9 @@
var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}';
var incomeTopLength = {{ incomeTopLength }};
var expenseTopLength = {{ expenseTopLength }};
var incomeRestShow = false; // starts hidden.
var expenseRestShow = false; // starts hidden.
var showTheRest = '{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}';
var hideTheRest = '{{ trans('firefly.hideTheRest',{number:incomeTopLength}) }}';
var showTheRestExpense = '{{ trans('firefly.showTheRest',{number:expenseTopLength}) }}';
var hideTheRestExpense = '{{ trans('firefly.hideTheRest',{number:expenseTopLength}) }}';
<!-- some URL's -->
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
</script>
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>

View File

@@ -6,8 +6,8 @@
<table class="table table-hover">
<tbody>
{% for expense in expenses.getExpenses %}
{% if loop.index > expenseTopLength %}
<tr class="collapse out expenseCollapsed">
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
@@ -32,7 +32,7 @@
{% if expenses.getExpenses|length > expenseTopLength %}
<tr>
<td colspan="2" class="active">
<a href="#" id="showExpenses">{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}</a>
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}

View File

@@ -6,8 +6,8 @@
<table class="table table-hover">
<tbody>
{% for income in incomes.getIncomes %}
{% if loop.index > incomeTopLength %}
<tr class="collapse out incomesCollapsed">
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
@@ -23,15 +23,16 @@
{% endif %}
</td>
<td>{{ income.amount|formatAmount }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if incomes.getIncomes|length > incomeTopLength %}
{% if incomes.getIncomes|length > listLength %}
<tr>
<td colspan="2" class="active">
<a href="#" id="showIncomes">{{ trans('firefly.showTheRest',{number:incomeTopLength}) }}</a>
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{ number:listLength } ) }}</a>
</td>
</tr>
{% endif %}