Optimise code.

This commit is contained in:
James Cole
2020-10-24 17:27:36 +02:00
parent b3f1737495
commit 3979e12043
21 changed files with 199 additions and 187 deletions
@@ -806,7 +806,7 @@ export default {
// console.log('Uploading attachment #' + key);
const uploadUri = './api/v1/attachments/' + response.data.data.id + '/upload';
axios.post(uploadUri, fileData[key].content)
.then(response => {
.then(secondResponse => {
// console.log('Uploaded attachment #' + key);
uploads++;
if (uploads === count) {
+2 -2
View File
@@ -171,13 +171,13 @@
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var doPlaceMarker = false;
// location stuff
{% if location %}
var latitude = {{ location.latitude|default("52.3167") }};
var longitude = {{ location.longitude|default("5.5500") }};
var zoomLevel = {{ location.zoom_level|default("6") }};
var doPlaceMarker = true;
doPlaceMarker = true;
// token for Mapbox:
var mapboxToken = "{{ config('firefly.mapbox_api_key') }}";
{% endif %}
+8 -12
View File
@@ -1,8 +1,4 @@
<!--
TODO: reconcile
TODO: hide and show columns
-->
<table class="table table-condensed table-hover table-responsive">
<table class="table table-condensed table-hover table-responsive table-sortable">
<thead>
<tr>
{% if showCategory or showBudget %}
@@ -53,7 +49,7 @@ TODO: hide and show columns
<tbody>
{% for group in groups %}
{% if group.count > 1 %}
<tr style="border-top:1px #aaa solid;">
<tr style="border-top:1px #aaa solid;" class="unsortable">
<td colspan="2" style="border-top:1px #aaa solid;">
<small><strong>
<a href="{{ route('transactions.show', [group.id]) }}"
@@ -102,25 +98,25 @@ TODO: hide and show columns
{% if group.transactions|length == loop.index and group.count > 1 %}
{% set style="border-bottom:1px #aaa solid;" %}
{% endif %}
<tr data-date="{{ transaction.date.format('Y-m-d') }}">
<tr data-date="{{ transaction.date.format('Y-m-d') }}" data-count="{{ group.count }}" data-id="{{ group.id }}">
<td style=" {{ style|raw }}" class="hidden-xs">
{% if transaction.transaction_type_type == 'Withdrawal' %}
<i class="fa fa-long-arrow-left fa-fw" title="{{ trans('firefly.Withdrawal') }}"></i>
<i class="object-handle fa fa-long-arrow-left fa-fw" title="{{ trans('firefly.Withdrawal') }}"></i>
{% endif %}
{% if transaction.transaction_type_type == 'Deposit' %}
<i class="fa fa-long-arrow-right fa-fw" title="{{ trans('firefly.Deposit') }}"></i>
<i class="object-handle fa fa-long-arrow-right fa-fw" title="{{ trans('firefly.Deposit') }}"></i>
{% endif %}
{% if transaction.transaction_type_type == 'Transfer' %}
<i class="fa fa-exchange fa-fw" title="{{ trans('firefly.Transfer') }}"></i>
<i class="object-handle fa fa-exchange fa-fw" title="{{ trans('firefly.Transfer') }}"></i>
{% endif %}
{% if transaction.transaction_type_type == 'Reconciliation' %}
<i class="fa-fw fa fa-calculator" title="{{ trans('firefly.reconciliation_transaction') }}"></i>
<i class="object-handle fa-fw fa fa-calculator" title="{{ trans('firefly.reconciliation_transaction') }}"></i>
{% endif %}
{% if transaction.transaction_type_type == 'Opening balance' %}
<i class="fa-fw fa fa-star-o" title="{{ trans('firefly.Opening balance') }}"></i>
<i class="object-handle fa-fw fa fa-star-o" title="{{ trans('firefly.Opening balance') }}"></i>
{% endif %}
</td>