feat(users): add account indicators to management page, update old refs

This commit is contained in:
2022-08-19 00:54:32 +01:00
parent e691e61bb5
commit 2b79ae4d09
7 changed files with 154 additions and 38 deletions

View File

@@ -78,8 +78,7 @@
<thead>
<tr>
<th>{{__('Name')}}</th>
<th>{{ __('Rank') }}</th>
<th>{{__('Status')}}</th>
<th>{{ __('Role') }}</th>
<th>{{__('Registration date')}}</th>
<th>{{__('Actions')}}</th>
</tr>
@@ -98,9 +97,6 @@
<span class="badge-warning badge"><i class="fas fa-user"></i> {{ __('Member') }}</span>
@endif
</td>
<td>
<x-account-status user-id="{{ $user->id }}"></x-account-status>
</td>
<td>{{$user->created_at}}</td>
<td>
<button type="button" class="btn btn-sm btn-success" onclick="window.location.href='{{route('showSingleProfile', ['user' => $user->id])}}'"><i class="fa fa-eye"></i> {{ __('View') }}</button>

View File

@@ -31,7 +31,7 @@
<div class="row">
<div class="col">
<label for="reason">{{__('Public note')}}</label>
<label for="reason">{{__('Reason')}}</label>
<input type="text" name="reason" id="reason" class="form-control" placeholder="{{__('e.g. Spamming')}}">
</div>
@@ -54,7 +54,7 @@
</form>
<x-slot name="modalFooter">
<button id="banAccountButton" type="button" class="btn btn-danger" {{ ($demoActive) ? 'disabled' : '' }} ><i class="fa fa-gavel"></i> {{__('Confirm')}}</button>
<button onclick="$('#banAccountForm').submit()" id="banAccountButton" type="button" class="btn btn-danger" {{ ($demoActive) ? 'disabled' : '' }} ><i class="fa fa-gavel"></i> {{__('Confirm')}}</button>
</x-slot>
</x-modal>
@@ -184,7 +184,7 @@
<div class="card">
<div class="card-header">
<h3>{{ __('Personal details') }}</h3>
<h3><i class="fas fa-user-alt"></i> {{ __('Personal details') }}</h3>
</div>
<div class="card-body">
@@ -197,11 +197,6 @@
<div class="col">
<label for="uemail">{{ __('Account email') }}</label>
@if(!is_null($user->email_verified_at))
<span class="badge badge-success ml-2"><i class="fas fa-check-square"> </i> {{ __('Verified') }}</span>
@else
<span class="badge badge-danger ml-2"><i class="fas fa-exclamation-circle"></i> {{ __('Not verified') }}</span>
@endif
<input id="uemail" type="email" class="form-control" value="{{ $user->email }}" disabled>
</div>
@@ -209,17 +204,30 @@
<div class="row">
<div class="col">
<label for="uip">{{ __('Current IP address') }}</label>
<input type="text" class="form-control" id="uip" value="{{ $user->originalIP }}" disabled>
<label for="uip">{{ __('Current IP') }}</label>
<input type="text" class="form-control" id="uip" value="{{ $user->currentIp }}" disabled>
</div>
<div class="col">
<label for="uip">{{ __('Registration IP') }}</label>
<input type="text" class="form-control" id="uip" value="{{ (empty($user->registrationIp)) ? __('Unavailable') : $user->registrationIp }}" disabled>
</div>
</div>
<div class="row">
<div class="col">
<label for="uregdate">{{ __('Registration date') }}</label>
<input id="uregdate" class="form-control" type="text" value="{{ $user->created_at }}" disabled>
<label for="uregdate">{{ __(' Registered at') }}</label>
<input id="uregdate" class="form-control" type="text" value="{{ $user->created_at }} ({{ $user->created_at->diffForHumans() }})" disabled>
</div>
</div>
<div class="mt-2">
<label>{{ __('Account indicators') }}</label>
<x-account-status is-verified="{{ $isVerified }}" is-locked="{{ $isLocked }}" is-suspended="{{ $isSuspended }}" has2-f-a="{{ $has2FA }}" />
</div>
</div>
<div class="card-footer">
<button onclick="$('#editUser').modal('show')" type="button" class="btn btn-warning"><i class="fas fa-pencil-alt"></i> {{ __('Edit account details') }}</button>
</div>
</div>
@@ -227,6 +235,120 @@
</div>
<div class="row mt-5">
<div class="col">
<div class="card">
<div class="card-header">
<h3><i class="fas fa-clipboard"></i> {{ __('Application history') }}</h3>
</div>
<div class="card-body">
@if (!$applications->isEmpty())
<table class="table table-borderless" style="whitespace: nowrap">
<thead>
<tr>
<th>#</th>
<th>{{__('Status')}}</th>
<th>{{ __('Vacancy') }}</th>
<th>{{__('Date')}}</th>
<th>{{__('Actions')}}</th>
</tr>
</thead>
<tbody>
@foreach($applications as $application)
<tr>
<td>{{ $application->id }}</td>
<td>
@switch($application->applicationStatus)
@case('STAGE_SUBMITTED')
<span class="badge badge-primary"><i class="far fa-clock"></i> {{__('Outstanding (Submitted)')}}</span>
@break
@case('STAGE_PEERAPPROVAL')
<span class="badge badge-warning"><i class="fas fa-vote-yea"></i> {{__('Peer Review')}}</span>
@break
@case('STAGE_INTERVIEW')
<span class="badge badge-warning"><i class="fas fa-microphone-alt"></i> {{__('Interview')}}</span>
@break
@case('STAGE_INTERVIEW_SCHEDULED')
<span class="badge badge-warning"><i class="far fa-clock"></i>{{__('Interview Scheduled')}}</span>
@break
@case('APPROVED')
<span class="badge badge-success"><i class="fas fa-check"></i> {{__('Approved')}}</span>
@break
@case('DENIED')
<span class="badge badge-danger"><i class="fas fa-times"></i> {{__('Denied')}}</span>
@break;
@default
<span class="badge badge-secondary"><i class="fas fa-question-circle"></i> {{__('Denied')}}</span>
@endswitch
</td>
<td>{{ $application->response->vacancy->vacancyName }}</td>
<td>{{ $application->created_at }} ({{ $application->created_at->diffForHumans() }})</td>
<td>
<x-button id="view" link="{{ route('showUserApp', ['application' => $application->id]) }}" icon="fas fa-eye" target="_blank" color="success" size="sm">
{{ __('View') }}
</x-button>
</td>
</tr>
@endforeach
</tbody>
</table>
@else
<x-alert alert-type="warning" icon="fas fa-exclamation-triangle" title="{{ __('No applications') }}">
{{ __('This user has not submitted any applications yet.') }}
</x-alert>
@endif
</div>
</div>
</div>
</div>
<div class="row mt-5 mb-5">
<div class="col">
<div class="card">
<div class="card-header">
<h3><i class="fas fa-shield-alt"></i> {{ __('Moderation actions') }}</h3>
</div>
<div class="card-body">
<button onclick="$('#banAccountModal').modal('show')" type="button" class="btn btn-warning mr-3"><i class="fas fa-user-slash"></i> {{ __('Suspend account') }}</button>
<button onclick="$('#deleteAccount').modal('show')" type="button" class="btn btn-danger"><i class="fas fa-trash"></i> {{ __('Delete account') }}</button>
</div>
</div>
</div>
</div>
@stop