mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-11 18:24:43 +02:00
Server: Improved user list page
This commit is contained in:
parent
37d446b970
commit
4d38397cd5
@ -45,6 +45,10 @@ table.table th .sort-button i {
|
|||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
table.table tr.is-disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,7 @@ router.get('users', async (_path: SubPath, ctx: AppContext) => {
|
|||||||
view.content.users = users.map(user => {
|
view.content.users = users.map(user => {
|
||||||
return {
|
return {
|
||||||
...user,
|
...user,
|
||||||
|
displayName: user.full_name ? user.full_name : '(not set)',
|
||||||
formattedItemMaxSize: formatMaxItemSize(user),
|
formattedItemMaxSize: formatMaxItemSize(user),
|
||||||
formattedTotalSize: formatTotalSize(user),
|
formattedTotalSize: formatTotalSize(user),
|
||||||
formattedMaxTotalSize: formatMaxTotalSize(user),
|
formattedMaxTotalSize: formatMaxTotalSize(user),
|
||||||
@ -114,6 +115,7 @@ router.get('users', async (_path: SubPath, ctx: AppContext) => {
|
|||||||
totalSizeClass: totalSizeClass(user),
|
totalSizeClass: totalSizeClass(user),
|
||||||
formattedAccountType: accountTypeToString(user.account_type),
|
formattedAccountType: accountTypeToString(user.account_type),
|
||||||
formattedCanShareFolder: yesOrNo(getCanShareFolder(user)),
|
formattedCanShareFolder: yesOrNo(getCanShareFolder(user)),
|
||||||
|
rowClassName: user.enabled ? '' : 'is-disabled',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return view;
|
return view;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<a class="button is-primary" href="{{{global.baseUrl}}}/users/new">Add user</a>
|
<a class="button is-primary" href="{{{global.baseUrl}}}/users/new">Add user</a>
|
||||||
|
<a class="button is-link toggle-disabled-button hide-disabled" href="#">Hide disabled</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
@ -12,24 +13,18 @@
|
|||||||
<th>Total Size</th>
|
<th>Total Size</th>
|
||||||
<th>Max Total Size</th>
|
<th>Max Total Size</th>
|
||||||
<th>Can share</th>
|
<th>Can share</th>
|
||||||
<th>Is admin?</th>
|
|
||||||
<th>Enabled?</th>
|
|
||||||
<th>Actions</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#users}}
|
{{#users}}
|
||||||
<tr>
|
<tr class="{{rowClassName}}">
|
||||||
<td>{{full_name}}</td>
|
<td><a href="{{{global.baseUrl}}}/users/{{id}}">{{displayName}}</a></td>
|
||||||
<td>{{email}}</td>
|
<td>{{email}}</td>
|
||||||
<td>{{formattedAccountType}}</td>
|
<td>{{formattedAccountType}}</td>
|
||||||
<td>{{formattedItemMaxSize}}</td>
|
<td>{{formattedItemMaxSize}}</td>
|
||||||
<td class="{{totalSizeClass}}">{{formattedTotalSize}} ({{formattedTotalSizePercent}})</td>
|
<td class="{{totalSizeClass}}">{{formattedTotalSize}} ({{formattedTotalSizePercent}})</td>
|
||||||
<td>{{formattedMaxTotalSize}}</td>
|
<td>{{formattedMaxTotalSize}}</td>
|
||||||
<td>{{formattedCanShareFolder}}</td>
|
<td>{{formattedCanShareFolder}}</td>
|
||||||
<td>{{is_admin}}</td>
|
|
||||||
<td>{{enabled}}</td>
|
|
||||||
<td><a href="{{{global.baseUrl}}}/users/{{id}}" class="button is-primary is-small">Edit</a></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{{/users}}
|
{{/users}}
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -37,4 +32,29 @@
|
|||||||
|
|
||||||
<div class="block">
|
<div class="block">
|
||||||
<a class="button is-primary" href="{{{global.baseUrl}}}/users/new">Add user</a>
|
<a class="button is-primary" href="{{{global.baseUrl}}}/users/new">Add user</a>
|
||||||
</div>
|
<a class="button is-link toggle-disabled-button hide-disabled" href="#">Hide disabled</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(() => {
|
||||||
|
function toggleDisabled() {
|
||||||
|
if ($('.hide-disabled').length) {
|
||||||
|
$('.hide-disabled').addClass('show-disabled');
|
||||||
|
$('.hide-disabled').removeClass('hide-disabled');
|
||||||
|
$('.show-disabled').text('Show disabled');
|
||||||
|
$('table tr.is-disabled').hide();
|
||||||
|
} else {
|
||||||
|
$('.show-disabled').addClass('hide-disabled');
|
||||||
|
$('.show-disabled').removeClass('show-disabled');
|
||||||
|
$('.hide-disabled').text('Hide disabled');
|
||||||
|
$('table tr.is-disabled').show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toggleDisabled();
|
||||||
|
|
||||||
|
$('.toggle-disabled-button').click(() => {
|
||||||
|
toggleDisabled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in New Issue
Block a user