implemented account list
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import { loadTranslation } from './translations.svelte';
|
||||
import { checkUser, user } from './user.svelte';
|
||||
|
||||
import Account from "./routes/accounting/account.svelte";
|
||||
import Accounts from "./routes/accounting/index.svelte";
|
||||
import AddDoc from "./routes/document/Add.svelte";
|
||||
import AddTask from "./routes/task/Add.svelte";
|
||||
@@ -90,6 +91,7 @@
|
||||
<span class="warn">{@html messages.warning}</span>
|
||||
{/if}
|
||||
<Route path="/" component={User} />
|
||||
<Route path="/account/:id" component={Account} />
|
||||
<Route path="/accounting" component={Accounts} />
|
||||
<Route path="/accounting/new" component={NewAccount} />
|
||||
<Route path="/bookmark" component={Bookmarks} />
|
||||
|
||||
5
frontend/src/routes/accounting/account.svelte
Normal file
5
frontend/src/routes/accounting/account.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let { id } = $props();
|
||||
|
||||
</script>
|
||||
<h1>Account {id}</h1>
|
||||
@@ -22,11 +22,29 @@
|
||||
router.navigate('/accounting/new');
|
||||
}
|
||||
|
||||
function onclick(e){
|
||||
e.preventDefault();
|
||||
let href = e.target.getAttribute('href');
|
||||
if (href) router.navigate(href);
|
||||
return false;
|
||||
}
|
||||
|
||||
onMount(load);
|
||||
</script>
|
||||
|
||||
<fieldset>
|
||||
<legend>{t('accounts')}</legend>
|
||||
|
||||
<button onclick={newAccount}>{t('create_new_object',{'object':t('account')})}</button>
|
||||
<span></span>
|
||||
<span>
|
||||
<button onclick={newAccount}>{t('create_new_object',{'object':t('account')})}</button>
|
||||
</span>
|
||||
|
||||
<ul>
|
||||
{#each accounts as account (account.id)}
|
||||
<li>
|
||||
<a {onclick} href="account/{account.id}">{account.name} ({account.id})</a>
|
||||
</li>
|
||||
{/each}
|
||||
</ul>
|
||||
</fieldset>
|
||||
Reference in New Issue
Block a user