Expand view.

This commit is contained in:
James Cole
2024-08-03 18:27:19 +02:00
parent 762d898fee
commit 3811aff206
7 changed files with 40 additions and 10 deletions

View File

@@ -30,13 +30,10 @@ use Illuminate\Support\Facades\Log;
class AccountPolicy
{
/**
* TODO needs better authentication.
* TODO needs better authentication, also for group.
*/
public function view(User $user, Account $account): bool
{
die('OK1');
return true;
return auth()->check() && $user->id === $account->user_id;
}

View File

@@ -345,7 +345,7 @@ let index = function () {
this.pageOptions.isLoading = true;
// sort instructions (only one column)
let sorting = this.pageOptions.sortingColumn;
if('asc' === this.pageOptions.sortDirection) {
if('asc' === this.pageOptions.sortDirection && '' !== sorting) {
sorting = '-' + sorting;
}
//const sorting = [{column: this.pageOptions.sortingColumn, direction: this.pageOptions.sortDirection}];

View File

@@ -243,10 +243,8 @@ export default () => ({
name: parent.attributes.name,
order: parent.attributes.order,
id: parent.id,
balance_raw: parseFloat(parent.attributes.current_balance),
balance: formatMoney(parent.attributes.current_balance, parent.attributes.currency_code),
native_balance_raw: parseFloat(parent.attributes.native_current_balance),
native_balance: formatMoney(parent.attributes.native_current_balance, parent.attributes.native_currency_code),
balance: parent.attributes.balance,
native_balance: parent.attributes.native_balance,
groups: groups,
});
// console.log(parent.attributes);

View File

@@ -45,6 +45,8 @@ import {
Tooltip
} from "chart.js";
import 'chartjs-adapter-date-fns';
import {showInternalsButton} from "../../support/page-settings/show-internals-button.js";
import {showWizardButton} from "../../support/page-settings/show-wizard-button.js";
// register things
Chart.register({
@@ -75,6 +77,8 @@ const comps = {
piggies
};
showInternalsButton();
//let i18n;
function loadPage(comps) {

View File

@@ -422,6 +422,7 @@
</div>
</div>
<!-- TODO this is a repeated piece of code -->
<div class="modal fade" id="filterModal" tabindex="-1" aria-labelledby="filterModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
@@ -448,6 +449,7 @@
</div>
</div>
<!-- TODO this is a repeated piece of code -->
<div class="modal fade" id="wizardModal" tabindex="-1" aria-labelledby="wizardModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">

View File

@@ -52,6 +52,30 @@
</div>
<!-- TODO this is a repeated piece of code -->
<div class="modal fade" id="filterModal" tabindex="-1" aria-labelledby="filterModalLabel" aria-hidden="true">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="filterModalLabel">TODO Options dialog</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Bla bla bla
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><em
class="fa-solid fa-right-from-bracket"></em> Cancel
</button>
<button type="button" class="btn btn-primary" data-bs-dismiss="modal"><em
class="fa-solid fa-magnifying-glass"></em> Search
</button>
</div>
</div>
</div>
</div>
@endsection
@section('scripts')
@vite(['src/pages/dashboard/dashboard.js'])

View File

@@ -13,7 +13,12 @@
x-text="account.name"></a>
<span class="small">
@include('partials.elements.amount', ['autoConversion' => true,'type' => 'null','amount' => 'account.balance','native' => 'account.native_balance'])
<template x-for="balance in account.balance">
<span>x</span>
</template>
<template x-for="balance in account.native_balance">
<span>Y</span>
</template>
</span>
</h3>
</div>