mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 03:08:11 +00:00
Better account index in v2.
This commit is contained in:
@@ -70,6 +70,9 @@ let index = function () {
|
||||
},
|
||||
totalPages: 1,
|
||||
page: 1,
|
||||
filters: {
|
||||
active: 'both',
|
||||
},
|
||||
|
||||
// available columns:
|
||||
// visible is hard coded, enabled is user-configurable.
|
||||
@@ -87,7 +90,7 @@ let index = function () {
|
||||
enabled: true,
|
||||
},
|
||||
type: {
|
||||
visible: true,
|
||||
visible: type === 'asset',
|
||||
enabled: true,
|
||||
},
|
||||
liability_type: {
|
||||
@@ -291,6 +294,14 @@ function loadPage() {
|
||||
let data = comps[comp]();
|
||||
Alpine.data(comp, () => data);
|
||||
});
|
||||
|
||||
|
||||
Alpine.magic("t", (el) => {
|
||||
return (name, vars) => {
|
||||
return i18next.t(name, vars);
|
||||
};
|
||||
});
|
||||
|
||||
Alpine.start();
|
||||
}
|
||||
|
||||
|
@@ -31,7 +31,17 @@ function manualChunks(id) {
|
||||
}
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
export default defineConfig(({command, mode, isSsrBuild, isPreview}) => {
|
||||
|
||||
let https = null;
|
||||
if (command === 'serve') {
|
||||
https = {
|
||||
key: fs.readFileSync(`/sites/vm/tls-certificates/wildcard.sd.internal.key`),
|
||||
cert: fs.readFileSync(`/sites/vm/tls-certificates/wildcard.sd.internal.crt`),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
base: './',
|
||||
build: {
|
||||
rollupOptions: {
|
||||
@@ -66,13 +76,12 @@ export default defineConfig({
|
||||
publicDirectory: '../../../public',
|
||||
refresh: true,
|
||||
}),
|
||||
manifestSRI(),
|
||||
//manifestSRI(),
|
||||
|
||||
],
|
||||
|
||||
|
||||
server: {
|
||||
usePolling: true,
|
||||
watch: {
|
||||
usePolling: true,
|
||||
},
|
||||
@@ -80,9 +89,7 @@ export default defineConfig({
|
||||
// hmr: {
|
||||
// protocol: 'wss',
|
||||
// },
|
||||
// https: {
|
||||
// key: fs.readFileSync(`/sites/vm/tls-certificates/wildcard.sd.internal.key`),
|
||||
// cert: fs.readFileSync(`/sites/vm/tls-certificates/wildcard.sd.internal.crt`),
|
||||
// },
|
||||
https: https,
|
||||
},
|
||||
}
|
||||
});
|
||||
|
@@ -1916,6 +1916,19 @@ return [
|
||||
'interest_calc_quarterly' => 'Per quarter',
|
||||
'initial_balance_account' => 'Initial balance account of :account',
|
||||
'list_options' => 'List options',
|
||||
'account_column_opt_drag_and_drop' => 'Drag and drop',
|
||||
'account_column_opt_active' => 'Active',
|
||||
'account_column_opt_name' => 'Name',
|
||||
'account_column_opt_type' => 'Type',
|
||||
'account_column_opt_liability_type' => 'Liability type',
|
||||
'account_column_opt_liability_direction' => 'Liability direction',
|
||||
'account_column_opt_liability_interest' => 'Liability interest',
|
||||
'account_column_opt_number' => 'Account number',
|
||||
'account_column_opt_current_balance' => 'Current balance',
|
||||
'account_column_opt_amount_due' => 'Amount due',
|
||||
'account_column_opt_last_activity' => 'Last activity',
|
||||
'account_column_opt_balance_difference' => 'Balance difference',
|
||||
'account_column_opt_menu' => 'Menu',
|
||||
|
||||
// categories:
|
||||
'new_category' => 'New category',
|
||||
|
@@ -58,6 +58,13 @@ return [
|
||||
'source' => 'Source',
|
||||
'next_expected_match' => 'Next expected match',
|
||||
'automatch' => 'Auto match?',
|
||||
'drag_and_drop' => 'Drag and drop',
|
||||
'number' => 'Account number',
|
||||
'current_balance' => 'Current balance',
|
||||
'last_activity' => 'Last activity',
|
||||
'amount_due' => 'Amount due',
|
||||
'balance_difference' => 'Balance difference',
|
||||
'menu' => 'Menu',
|
||||
|
||||
// Ignore this comment
|
||||
|
||||
|
@@ -56,45 +56,68 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td x-show="tableColumns.drag_and_drop.visible && tableColumns.drag_and_drop.enabled"> </td>
|
||||
<td x-show="tableColumns.drag_and_drop.visible && tableColumns.drag_and_drop.enabled">
|
||||
|
||||
</td>
|
||||
<td x-show="tableColumns.active.visible && tableColumns.active.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('active')">Active?</a>
|
||||
<em x-show="sortingColumn === 'active' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'active' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'active' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'active' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.name.visible && tableColumns.name.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('name')">Name</a>
|
||||
<em x-show="sortingColumn === 'name' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-z-a"></em>
|
||||
<em x-show="sortingColumn === 'name' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-z-a"></em>
|
||||
<em x-show="sortingColumn === 'name' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-z-a"></em>
|
||||
<em x-show="sortingColumn === 'name' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-z-a"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.type.visible && tableColumns.type.enabled">Type</td>
|
||||
<td x-show="tableColumns.liability_type.visible && tableColumns.liability_type.enabled">Liability type</td>
|
||||
<td x-show="tableColumns.liability_direction.visible && tableColumns.liability_direction.enabled">Liability direction</td>
|
||||
<td x-show="tableColumns.liability_interest.visible && tableColumns.liability_interest.enabled">Liability interest</td>
|
||||
<td x-show="tableColumns.liability_type.visible && tableColumns.liability_type.enabled">
|
||||
Liability type
|
||||
</td>
|
||||
<td x-show="tableColumns.liability_direction.visible && tableColumns.liability_direction.enabled">
|
||||
Liability direction
|
||||
</td>
|
||||
<td x-show="tableColumns.liability_interest.visible && tableColumns.liability_interest.enabled">
|
||||
Liability interest
|
||||
</td>
|
||||
<td x-show="tableColumns.number.visible && tableColumns.number.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('iban')">Account number</a>
|
||||
<em x-show="sortingColumn === 'iban' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-z-a"></em>
|
||||
<em x-show="sortingColumn === 'iban' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-z-a"></em>
|
||||
<em x-show="sortingColumn === 'iban' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-z-a"></em>
|
||||
<em x-show="sortingColumn === 'iban' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-z-a"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.current_balance.visible && tableColumns.current_balance.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('balance')">Current balance</a>
|
||||
<em x-show="sortingColumn === 'balance' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'balance' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'balance' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'balance' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.amount_due.visible && tableColumns.amount_due.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('amount_due')">Current balance</a>
|
||||
<em x-show="sortingColumn === 'amount_due' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'amount_due' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
<a href="#" x-on:click.prevent="sort('amount_due')">Amount due</a>
|
||||
<em x-show="sortingColumn === 'amount_due' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'amount_due' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.last_activity.visible && tableColumns.last_activity.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('last_activity')">Last activity</a>
|
||||
<em x-show="sortingColumn === 'last_activity' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'last_activity' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'last_activity' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'last_activity' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.balance_difference.visible && tableColumns.balance_difference.enabled">
|
||||
<a href="#" x-on:click.prevent="sort('balance_difference')">Balance difference</a>
|
||||
<em x-show="sortingColumn === 'balance_difference' && sortDirection === 'asc'" class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'balance_difference' && sortDirection === 'desc'" class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
<a href="#" x-on:click.prevent="sort('balance_difference')">Balance
|
||||
difference</a>
|
||||
<em x-show="sortingColumn === 'balance_difference' && sortDirection === 'asc'"
|
||||
class="fa-solid fa-arrow-down-wide-short"></em>
|
||||
<em x-show="sortingColumn === 'balance_difference' && sortDirection === 'desc'"
|
||||
class="fa-solid fa-arrow-up-wide-short"></em>
|
||||
</td>
|
||||
<td x-show="tableColumns.menu.visible && tableColumns.menu.enabled"> </td>
|
||||
</tr>
|
||||
@@ -108,27 +131,43 @@
|
||||
<td x-show="tableColumns.active.visible && tableColumns.active.enabled">
|
||||
<template x-if="account.active">
|
||||
<em class="text-success fa-solid fa-check"></em>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
<template x-if="!account.active">
|
||||
<em class="text-danger fa-solid fa-xmark"></em>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="tableColumns.name.visible && tableColumns.name.enabled">
|
||||
<!-- render content using a function -->
|
||||
<span x-html="renderObjectValue('name', account)" x-show="!account.nameEditorVisible"></span>
|
||||
<span x-html="renderObjectValue('name', account)"
|
||||
x-show="!account.nameEditorVisible"></span>
|
||||
|
||||
<!-- edit buttons -->
|
||||
<em x-show="!account.nameEditorVisible" :data-id="account.id" :data-index="index" @click="triggerEdit" data-type="text" class="hidden-edit-button inline-edit-button fa-solid fa-pencil" :data-id="account.id"></em>
|
||||
<em x-show="!account.nameEditorVisible" :data-id="account.id"
|
||||
:data-index="index" @click="triggerEdit" data-type="text"
|
||||
class="hidden-edit-button inline-edit-button fa-solid fa-pencil"
|
||||
:data-id="account.id"></em>
|
||||
|
||||
<!-- edit things -->
|
||||
<div class="row" x-show="account.nameEditorVisible">
|
||||
<div class="col-8">
|
||||
<input :data-index="index" data-field="name" autocomplete="off" type="text" class="form-control form-control-sm" id="input" name="name" :value="account.name" :placeholder="account.value" autofocus>
|
||||
<input :data-index="index" data-field="name" autocomplete="off"
|
||||
type="text" class="form-control form-control-sm" id="input"
|
||||
name="name" :value="account.name"
|
||||
:placeholder="account.value" autofocus>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="btn-group btn-group-sm" role="group" aria-label="Options">
|
||||
<button :data-index="index" :data-id="account.id" data-field="name" type="button" @click="cancelInlineEdit" class="btn btn-danger"><em class="fa-solid fa-xmark text-white"></em></button>
|
||||
<button :data-index="index" :data-id="account.id" data-field="name" type="submit" @click="submitInlineEdit" class="btn btn-success"><em class="fa-solid fa-check"></em></button>
|
||||
<div class="btn-group btn-group-sm" role="group"
|
||||
aria-label="Options">
|
||||
<button :data-index="index" :data-id="account.id"
|
||||
data-field="name" type="button"
|
||||
@click="cancelInlineEdit" class="btn btn-danger"><em
|
||||
class="fa-solid fa-xmark text-white"></em></button>
|
||||
<button :data-index="index" :data-id="account.id"
|
||||
data-field="name" type="submit"
|
||||
@click="submitInlineEdit" class="btn btn-success"><em
|
||||
class="fa-solid fa-check"></em></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -162,7 +201,8 @@
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="tableColumns.current_balance.visible && tableColumns.current_balance.enabled">
|
||||
<span x-text="formatMoney(account.current_balance, account.currency_code)"></span>
|
||||
<span
|
||||
x-text="formatMoney(account.current_balance, account.currency_code)"></span>
|
||||
</td>
|
||||
<td x-show="tableColumns.amount_due.visible && tableColumns.amount_due.enabled">
|
||||
TODO
|
||||
@@ -172,19 +212,33 @@
|
||||
</td>
|
||||
<td x-show="tableColumns.balance_difference.visible && tableColumns.balance_difference.enabled">
|
||||
<template x-if="null !== account.balance_difference">
|
||||
<span x-text="formatMoney(account.balance_difference, account.currency_code)"></span>
|
||||
<span
|
||||
x-text="formatMoney(account.balance_difference, account.currency_code)"></span>
|
||||
</template>
|
||||
</td>
|
||||
<td x-show="tableColumns.menu.visible && tableColumns.menu.enabled">
|
||||
<div class="btn-group btn-group-sm">
|
||||
<a :href="'./accounts/edit/' + account.id" class="btn btn-sm btn-light"><em class="fa-solid fa-pencil"></em></a>
|
||||
<button type="button" class="btn btn-light dropdown-toggle dropdown-toggle-split" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span class="visually-hidden">{{ __('firefly.toggle_dropdown') }}</span>
|
||||
<a :href="'./accounts/edit/' + account.id" class="btn btn-sm btn-light"><em
|
||||
class="fa-solid fa-pencil"></em></a>
|
||||
<button type="button"
|
||||
class="btn btn-light dropdown-toggle dropdown-toggle-split"
|
||||
data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<span
|
||||
class="visually-hidden">{{ __('firefly.toggle_dropdown') }}</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a class="dropdown-item" :href="'./accounts/show/' + account.id"><em class="fa-solid fa-eye"></em> {{ __('firefly.show') }}</a></li>
|
||||
<li><a class="dropdown-item" :href="'./accounts/reconcile/' + account.id"><em class="fa-solid fa-calculator"></em> {{ __('firefly.reconcile_selected') }}</a></li>
|
||||
<li><a class="dropdown-item" :href="'./accounts/delete/' + account.id"><em class="fa-solid fa-trash"></em> {{ __('firefly.delete') }}</a></li>
|
||||
<li><a class="dropdown-item"
|
||||
:href="'./accounts/show/' + account.id"><em
|
||||
class="fa-solid fa-eye"></em> {{ __('firefly.show') }}
|
||||
</a></li>
|
||||
<li><a class="dropdown-item"
|
||||
:href="'./accounts/reconcile/' + account.id"><em
|
||||
class="fa-solid fa-calculator"></em> {{ __('firefly.reconcile_selected') }}
|
||||
</a></li>
|
||||
<li><a class="dropdown-item"
|
||||
:href="'./accounts/delete/' + account.id"><em
|
||||
class="fa-solid fa-trash"></em> {{ __('firefly.delete') }}
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
@@ -205,7 +259,8 @@
|
||||
</div>
|
||||
|
||||
<!-- Internal settings modal -->
|
||||
<div class="modal fade" id="internalsModal" tabindex="-1" aria-labelledby="internalsModalLabel" aria-hidden="true">
|
||||
<div class="modal fade" id="internalsModal" tabindex="-1" aria-labelledby="internalsModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
@@ -213,16 +268,27 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<h2>Visible columns</h2>
|
||||
<h5>Visible columns</h5>
|
||||
<div class="mb-2">
|
||||
<template x-for="(column, key) in tableColumns" :key="key">
|
||||
<div class="form-check" x-show="column.visible">
|
||||
<input class="form-check-input" type="checkbox" x-model="column.enabled" @change="saveColumnSettings"> <span x-text="key"></span>
|
||||
<label>
|
||||
<input class="form-check-input" type="checkbox" x-model="column.enabled"
|
||||
@change="saveColumnSettings"> <span x-text="$t('list.'+key)"></span>
|
||||
</label>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<h5>Options</h5>
|
||||
<div class="mb-2">
|
||||
<select x-model="filters.active" class="form-control">
|
||||
<option value="active" label="Active accounts">Active accounts</option>
|
||||
<option value="inactive" label="Inactive accounts">Inactive accounts</option>
|
||||
<option value="both" label="Both">Both</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
- Group accounts <br>
|
||||
- Columns to show<br>
|
||||
- Show / hide inactive accounts (dropdown: both, active inactive only)<br>
|
||||
- default sort field<br>
|
||||
- default sort direction<br>
|
||||
- show info boxes (once they contain info)<br>
|
||||
@@ -248,15 +314,17 @@
|
||||
Take me to the help pages (opens in a new window or tab)
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal"><em class="fa-solid fa-hat-wizard"></em> Show me around</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"> <em class="fa-solid fa-right-from-bracket"></em> Take me to the documentation</button>
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal"><em
|
||||
class="fa-solid fa-hat-wizard"></em> Show me around
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal"><em
|
||||
class="fa-solid fa-right-from-bracket"></em> Take me to the documentation
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
@section('scripts')
|
||||
@vite(['src/pages/accounts/index.js'])
|
||||
|
Reference in New Issue
Block a user