Small tweaks to user export, user view translations

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-05-30 13:59:00 +01:00
parent f710b1aac3
commit a46e2ebfd8
3 changed files with 10 additions and 6 deletions

View file

@ -563,7 +563,7 @@ class UsersController extends Controller
trans('general.accessories'),
trans('general.consumables'),
trans('general.groups'),
trans('general.permission_level'),
trans('general.permissions'),
trans('general.notes'),
trans('admin/users/table.activated'),
trans('general.created_at'),
@ -580,10 +580,11 @@ class UsersController extends Controller
$permissionstring = "";
if(array_key_exists("superuser", json_decode($user->permissions, true))) {
if($user->isSuperUser()) {
$permissionstring = trans('general.superuser');
}
elseif(array_key_exists("admin", json_decode($user->permissions, true))) {
elseif($user->hasAccess('admin')) {
$permissionstring = trans('general.admin');
}
else {

View file

@ -11,6 +11,9 @@ return [
'activity_report' => 'Activity Report',
'address' => 'Address',
'admin' => 'Admin',
'admin_tooltip' => 'This user has admin privileges',
'superuser' => 'Superuser',
'superuser_tooltip' => 'This user has superuser privileges',
'administrator' => 'Administrator',
'add_seats' => 'Added seats',
'age' => "Age",

View file

@ -167,7 +167,7 @@
@if (($user->isSuperUser()) || ($user->hasAccess('admin')))
<i class="fas fa-crown fa-2x{{ ($user->isSuperUser()) ? ' text-danger' : ' text-orange'}}"></i>
<div class="{{ ($user->isSuperUser()) ? 'text-danger' : ' text-orange'}}" style="font-weight: bold">{{ ($user->isSuperUser()) ? 'superadmin' : 'admin'}}</div>
<div class="{{ ($user->isSuperUser()) ? 'text-danger' : ' text-orange'}}" style="font-weight: bold">{{ ($user->isSuperUser()) ? strtolower(trans('general.superuser')) : strtolower(trans('general.admin')) }}</div>
@endif
@ -309,9 +309,9 @@
<div class="col-md-9">
@if ($user->isSuperUser())
<label class="label label-danger"><i class="fas fa-crown" title="superuser"></i></label>&nbsp;
<label class="label label-danger" data-tooltip="true" title="{{ trans('general.superuser_tooltip') }}"><i class="fas fa-crown" title="{{ trans('general.superuser') }}"></i></label>&nbsp;
@elseif ($user->hasAccess('admin'))
<label class="label label-warning"><i class="fas fa-crown" title="admin"></i></label>&nbsp;
<label class="label label-warning" data-tooltip="true" title="{{ trans('general.admin_tooltip') }}"><i class="fas fa-crown" title="{{ trans('general.admin') }}"></i></label>&nbsp;
@endif
{{ $user->username }}