implemented user list and editing other users for admin
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user