implemented user list and editing other users for admin

This commit is contained in:
2025-07-02 22:08:36 +02:00
parent 10c24dd93d
commit ea6ca9e45d
8 changed files with 162 additions and 69 deletions

View File

@@ -1,10 +1,13 @@
<script>
import { t } from '../../translations.svelte.js';
import { user } from '../../user.svelte.js';
import ClickInput from '../../Components/ClickInput.svelte';
import ClickSelect from '../../Components/ClickSelect.svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import EditPassword from './EditPassword.svelte';
import UserList from './List.svelte';
const router = useTinyRouter();
let editPassword = false;
async function patch(changeset){
@@ -31,7 +34,7 @@
<fieldset>
<legend>
{t('user.profile')}
{t('user.your_profile')} <button onclick={() => router.navigate(`/user/${user.id}/edit`)}>{t('user.edit')}</button>
</legend>
<table>
<tbody>
@@ -41,9 +44,7 @@
</tr>
<tr>
<th>{t('user.name')}</th>
<td>
<ClickInput key='name' value={user.name} onUpdate={patch} />
</td>
<td>{user.name}</td>
</tr>
<tr>
<th>{t('user.login')}</th>
@@ -51,21 +52,15 @@
</tr>
<tr>
<th>{t('user.email')}</th>
<td>
<ClickInput key='email' value={user.email} onUpdate={patch} />
</td>
<td>{user.email}</td>
</tr>
<tr>
<th>{t('user.language')}</th>
<td>
<ClickInput key='language' value={user.language} onUpdate={patch} />
</td>
<td>{user.language}</td>
</tr>
<tr>
<th>{t('user.theme')}</th>
<td>
<ClickSelect key='theme' value={user.theme} fetchOptions={fetchThemes} onUpdate={patch} />
</td>
<td>{user.theme}</td>
</tr>
<tr>
<th>{t('user.password')}</th>