Centered elements

This commit is contained in:
Julian Prieber 2024-01-02 22:42:57 +01:00
parent bc967852a4
commit d2ad69002e
1 changed files with 7 additions and 7 deletions

View File

@ -61,20 +61,20 @@ class UserTable extends DataTableComponent
->format(function ($value, $row, Column $column) { ->format(function ($value, $row, Column $column) {
if (env('REGISTER_AUTH') !== 'auth') { if (env('REGISTER_AUTH') !== 'auth') {
if ($row->role == 'admin' && $row->email_verified_at != '') { if ($row->role == 'admin' && $row->email_verified_at != '') {
return '<center>-</center>'; return '<div class="text-center">-</div>';
} else { } else {
$verifyLink = route('verifyUser', [ $verifyLink = route('verifyUser', [
'verify' => '-' . $row->email_verified_at, 'verify' => '-' . $row->email_verified_at,
'id' => $row->id 'id' => $row->id
]); ]);
if ($row->email_verified_at == '') { if ($row->email_verified_at == '') {
return '<a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a>'; return '<div class="text-center"><a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>';
} else { } else {
return '<a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-success">' . __('messages.Verified') . '</span></a>'; return '<div class="text-center"><a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-success">' . __('messages.Verified') . '</span></a></div>';
} }
} }
} else { } else {
return '<center>-</center>'; return '<div class="text-center">-</div>';
} }
return ''; return '';
})->html(), })->html(),
@ -82,13 +82,13 @@ class UserTable extends DataTableComponent
->sortable() ->sortable()
->format(function ($value, $row, Column $column) { ->format(function ($value, $row, Column $column) {
if ($row->role === 'admin' && $row->id === 1) { if ($row->role === 'admin' && $row->id === 1) {
return '<center>-</center>'; return '<div class="text-center">-</div>';
} else { } else {
$route = route('blockUser', ['block' => $row->block, 'id' => $row->id]); $route = route('blockUser', ['block' => $row->block, 'id' => $row->id]);
if ($row->block === 'yes') { if ($row->block === 'yes') {
$badge = '<a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-danger">'.__('messages.Pending').'</span></a>'; $badge = '<div class="text-center"><a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-danger">'.__('messages.Pending').'</span></a></div>';
} elseif ($row->block === 'no') { } elseif ($row->block === 'no') {
$badge = '<a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-success">'.__('messages.Approved').'</span></a>'; $badge = '<div class="text-center"><a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-success">'.__('messages.Approved').'</span></a></div>';
} }
return "<a href=\"$route\">$badge</a>"; return "<a href=\"$route\">$badge</a>";
} }