Beta version

This commit is too large to list all changes.
This commit is contained in:
2020-06-27 00:32:33 +01:00
parent d15c0cb12f
commit 5a8c080a31
135 changed files with 8534 additions and 12774 deletions

View File

@@ -44,8 +44,8 @@
<div class="alert alert-warning">
<i class="fa fa-exclamation-triangle"></i> <b>Warning: Do not use these options if you don't know what you're doing, even if you have access to this page.</b>
<i class="fa fa-exclamation-triangle"></i> <b>Warning</b>
<p>Do not use these options if you don't know what you're doing, even if you have access to this page.</p>
</div>
</div>
@@ -60,11 +60,11 @@
<x-slot name="cardHeader">
</x-slot>
<button type="button" class="btn btn-danger" onclick="$('#confirmForceEventDispatch').modal('show')">Force Vote Evaluation</button>
<button type="button" class="btn btn-danger" onclick="$('#confirmForceEventDispatch').modal('show')">Override Vote Evaluation</button>
<button type="button" class="btn btn-warning ml-3">Artisan: Evaluate Votes Now</button>
<x-slot name="cardFooter">
<p class="text-muted"> This panel may be also used to completely override the vote system in stalemate scenarios.</p>
</x-slot>
</x-card>

View File

@@ -8,6 +8,12 @@
@stop
@section('js')
<x-global-errors></x-global-errors>
@stop
@section('content')
<div class="row">
@@ -15,7 +21,7 @@
<div class="col">
<div class="small-box bg-info">
<div class="inner">
<h3>11</h3>
<h3>{{$users->count()}}</h3>
<p>Registered Players</p>
</div>
@@ -29,7 +35,7 @@
<div class="small-box bg-danger">
<div class="inner">
<h3>200</h3>
<h3>{{$bannedUserCount}}</h3>
<p>Total Banned Players</p>
</div>
@@ -40,6 +46,7 @@
</div>
</div>
I
<div class="row">
@@ -53,10 +60,10 @@
<div class="card-body">
<form name="search">
<form name="search" method="POST" action="{{route('searchRegisteredPLayerList')}}">
@csrf
<div class="input-group">
<input type="text" class="form-control" placeholder="Username or UUID, etc...">
<input type="text" name="searchTerm" class="form-control" placeholder="Username/email search">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<i class="fa fa-search"></i>
@@ -101,7 +108,7 @@
</div>
<div class="card-body">
@if (!$users->isEmpty())
<table class="table table-borderless table-active">
<thead>
@@ -117,21 +124,41 @@
<tbody>
<tr>
<td>1</td>
<td>Notch</td>
<td>069a79f4-44e9-4726-a5be-fca90e38aaf5</td>
<td><span class="badge badge-success">Active</span></td>
<td>2020-02-10</td>
<td>
<button type="button" class="btn btn-sm btn-success"><i class="fa fa-eye"></i> View Record</button>
@foreach($users as $user)
<tr>
<td>{{$user->id}}</td>
<td>{{UUID::toUsername($user->uuid)}}</td>
<td>{{$user->uuid}}</td>
<td>
@if ($user->isBanned())
<span class="badge badge-danger"><i class="fa fa-ban"></i> Banned</span>
@else
<span class="badge badge-success">Active</span>
@endif
</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></button>
</td>
</tr>
</tr>
@endforeach
</tbody>
</table>
@else
<div class="alert alert-secondary">
<i class="fas fa-question"></i><span> There are no registered players!</span>
<p>
Registered players are those without a staff role in the team management application.
There may be other users registered in the platform, but they won't be displayed here.
</p>
</div>
@endif
</div>
<div class="card-footer">

View File

@@ -15,7 +15,7 @@
<div class="col">
<div class="small-box bg-info">
<div class="inner">
<h3>11</h3>
<h3>{{$users->count()}}</h3>
<p>Active Staff Members</p>
</div>
@@ -24,68 +24,6 @@
</div>
</div>
</div>
<div class="col">
<div class="small-box bg-warning">
<div class="inner">
<h3>2</h3>
<p>Former Staff Members</p>
</div>
<div class="icon">
<i class="fa fa-users"></i>
</div>
</div>
</div>
<div class="col">
<div class="small-box bg-danger">
<div class="inner">
<h3>1</h3>
<p>Terminated Staff Member(s)</p>
</div>
<div class="icon">
<i class="fas fa-user-alt-slash"></i>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 offset-md-4">
<div class="card">
<div class="card-header">
<div class="card-title"><h4><i class="fas fa-search"></i>Search Active Members</h4></div>
</div>
<div class="card-body">
<form name="search">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search for names, email addresses, etc...">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
@@ -109,7 +47,7 @@
<tr>
<th>#</th>
<th>Full Name</th>
<th>IGN</th>
<th>UUID</th>
<th>Rank</th>
<th>Status</th>
<th>Join Date</th>
@@ -119,51 +57,27 @@
<tbody>
<tr>
<td>1</td>
<td>Monica Smith</td>
<td>mssmith223</td>
<td><span class="badge badge-success">Moderator</span></td>
<td><span class="badge badge-success">Active</span></td>
<td>2020-02-10</td>
<td>
<button type="button" class="btn btn-sm btn-success"><i class="fa fa-eye"></i> Staff Record</button>
</td>
</tr>
<tr>
<td>2</td>
<td>Zak Unknown</td>
<td>Skeppy</td>
<td><span class="badge badge-info">Helper</span></td>
<td><span class="badge badge-success">Active</span></td>
<td>2020-02-10</td>
<td>
<button type="button" class="btn btn-sm btn-success"><i class="fa fa-eye"></i> Staff Record</button>
</td>
</tr>
<tr>
<td>3</td>
<td>John Doe</td>
<td>kjj192</td>
<td><span class="badge badge-danger">Admin</span></td>
<td><span class="badge badge-success">Active</span></td>
<td>2020-02-10</td>
<td>
<button type="button" class="btn btn-sm btn-success"><i class="fa fa-eye"></i> Staff Record</button>
</td>
</tr>
<tr>
<td>4</td>
<td>Angela Smith</td>
<td>kkrapsody1221</td>
<td><span class="badge badge-success">Moderator</span></td>
<td><span class="badge badge-success">Active</span></td>
<td>2020-02-10</td>
<td>
<button type="button" class="btn btn-sm btn-success"><i class="fa fa-eye"></i> Staff Record</button>
</td>
</tr>
@foreach($users as $user)
<tr>
<td>1</td>
<td>{{$user->name}}</td>
<td>{{UUID::toUsername($user->uuid)}}</td>
<td>
@foreach($user->roles as $role)
<span class="badge badge-info badge-sm">{{$role->name}}</span>
@endforeach
</td>
<td><span class="badge badge-success">Active</span></td>
<td>{{$user->created_at}}</td>
<td>
<button type="button" class="btn btn-sm btn-success mr-2" onclick="window.location.href='{{route('showSingleProfile', ['user' => $user->id])}}'"><i class="fa fa-eye"></i></button>
<button type="button" class="btn btn-sm btn-warning mr-2"><i class="fas fa-pencil-alt"></i></button>
</td>
</tr>
@endforeach
</tbody>
</table>

View File

@@ -141,9 +141,15 @@
<tr>
<td>{{$upcomingApp->id}}</td>
<td>{{$upcomingApp->user->name}}</td>
<td><span class="badge badge-success"><i class="fa fa-check"></i> {{ucfirst(strtolower($upcomingApp->appointment->appointmentStatus))}}</span></td>
<td>{{$upcomingApp->appointment->appointmentDate}}</td>
<td><span class="badge badge-success"><i class="fa fa-check"></i> {{ucfirst(strtolower($upcomingApp->appointment->appointmentLocation))}}</span></td>
@if (is_null($upcomingApp->appointment))
<td><span class="badge badge-warning"><i class="fa fa-question-circle"></i>Pending Schedule</span></td>
<td>None yet</td>
<td><span class="badge badge-warning"><i class="fa fa-question-circle"></i>Pending Schedule</span></td>
@else
<td><span class="badge badge-success"><i class="fa fa-check"></i> {{ucfirst(strtolower($upcomingApp->appointment->appointmentStatus))}}</span></td>
<td>{{$upcomingApp->appointment->appointmentDate}}</td>
<td><span class="badge badge-success"><i class="fa fa-check"></i> {{ucfirst(strtolower($upcomingApp->appointment->appointmentLocation))}}</span></td>
@endif
<td>
<button type="button" class="btn btn-sm btn-success" onclick="window.location.href='{{route('showUserApp', ['id' => $upcomingApp->id])}}'"><i class="fa fa-eye"></i> View Details</button>
</td>

View File

@@ -10,19 +10,7 @@
@section('js')
@if (session()->has('success'))
<script>
toastr.success("{{session('success')}}")
</script>
@elseif(session()->has('error'))
<script>
toastr.error("{{session('error')}}")
</script>
@endif
<x-global-errors></x-global-errors>
@stop
@@ -121,7 +109,7 @@
</td>
<td>
<button type="button" class="btn btn-success"><i class="fa fa-eye"></i> View</button>
<button type="button" class="btn btn-success" onclick="window.location.href='{{route('showUserApp', ['id' => $application->id])}}'"><i class="fa fa-eye"></i> View</button>
</td>
</tr>

View File

@@ -0,0 +1,411 @@
@extends('adminlte::page')
@section('title', 'Raspberry Network | ' . $profile->user->name . '\'s profile')
@section('content_header')
<h4>Profile</h4>
@stop
@section('js')
<script src="/js/app.js"></script>
<x-global-errors></x-global-errors>
@stop
@section('content')
@if ($profile->user->isBanned())
<div class="alert alert-danger">
<span><i class="fa fa-ban"></i> <b>Account banned</b></span>
<p>This user has been banned by the moderators.</p>
<p>
<i class="fas fa-chevron-right"></i> <b>{{$profile->user->bans->reason}}</>
</p>
</div>
@endif
@if (Auth::user()->hasRole('admin'))
<x-modal id="banAccountModal" modal-label="banAccount" modal-title="Please confirm" include-close-button="true">
<p>Please confirm that you want to ban this user account. You'll need to add a reason and expiration date to confirm this. Bans don't transfer to connected Minecraft networks (yet).</p>
<form id="banAccountForm" name="banAccount" method="POST" action="{{route('banUser', ['user' => $profile->user->id])}}">
@csrf
<label for="reason">Reason</label>
<input type="string" name="reason" id="reason" class="form-control" placeholder="e.g. Spamming">
<div class="input-group">
<input type="text" class="form-control" name="durationOperand" aria-label="Punishment duration">
<div class="input-group-append">
<button id="durationDropdown" class="btn btn-outline-secondary dropdown-toggle duration-btn" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Duration</button>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Days</a>
<a class="dropdown-item" href="#">Weeks</a>
<a class="dropdown-item" href="#">Months</a>
<div role="separator" class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Years</a>
</div>
</div>
</div>
<p class="text-muted text-sm">Leave empty for a permanent ban</p>
<input id="operator" type="hidden" value="" name="durationOperator" class="duration-operator-fld">
</form>
<x-slot name="modalFooter">
<button id="banAccountButton" type="button" class="btn btn-danger"><i class="fa fa-ban"></i> Ban</button>
</x-slot>
</x-modal>
@if (!Auth::user()->is($profile->user) && $profile->user->isStaffMember())
<x-modal id="terminateUser" modal-label="terminateUser" modal-title="Please confirm" include-close-button="true">
<p><i class="fa fa-exclamation-triangle"></i> <b>You are about to terminate a staff member</b></p>
<p>
Terminating a staff member will remove their privileges on the team management site and Network.
They will be notified of their termination. Make sure to have discussed this with them first.
</p>
<p>
<b>THIS PROCESS IS IRREVERSIBLE AND IMMEDIATE</b>
</p>
<x-slot name="modalFooter">
<form method="POST" action="{{route('terminateStaffMember', ['user' => $profile->user->id])}}" id="terminateUserForm">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-warning"><i class="fas fa-exclamation-circle"></i> Confirm</button>
</form>
</x-slot>
</x-modal>
@endif
<x-modal id="deleteAccount" modal-label="deleteAccount" modal-title="Please confirm" include-close-button="true">
<p><i class="fa fa-exclamation-triangle"></i><b> WARNING: This is a potentially destructive action!</b></p>
<p>Deleting a user's account is an irreversible process. Historic and current applications, votes, and profile content, as well as any personally identifiable information will be immediately erased.</p>
<form id="deleteAccountForm" method="POST" action={{route('deleteUser', ['user' => $profile->user->id])}}>
@csrf
@method('DELETE')
<label for="promptConfirm">Type to confirm: "DELETE ACCOUNT"</label>
<input type="text" name="confirmPrompt" class="form-control" placeholder="Please type the above">
</form>
<x-slot name="modalFooter">
<button type="button" class="btn btn-danger" onclick="document.getElementById('deleteAccountForm').submit()"><i class="fa fa-trash"></i> CONFIRM</button>
</x-slot>
</x-modal>
<x-modal id="ipInfo" modal-label="ipInfo" modal-title="IP Address Information for {{$ipInfo->ip ?? 'Unknown'}}" include-close-button="true">
<h4 class="text-center">Search results</h3>
@if (!isset($ipInfo->message))
<table class="table table-borderless">
<tbody>
<tr>
<th>Origin Country</th>
<td>{{$ipInfo->country_name ?? 'N/A'}}</td>
</tr>
<tr>
<th>State/Province</th>
<td>{{$ipInfo->state_prov ?? 'None'}}</td>
</tr>
<tr>
<th>District (if any)</th>
<td>{{$ipInfo->district ?? 'N/A'}}</td>
</tr>
<tr>
<th>City</th>
<td>{{$ipInfo->city ?? 'N/A'}}</td>
</tr>
<tr>
<th>Zipcode</th>
<td>{{$ipInfo->zipcode ?? 'N/A'}}</td>
</tr>
<tr>
<th>Coordinates</th>
<td>{{$ipInfo->latitude ?? 0}}, {{$ipInfo->longitude ?? 0}}</td>
</tr>
<tr>
<th>European?</th>
<td>{{($ipInfo->is_eu) ? 'Yes' : 'No'}}</td>
</tr>
<tr>
<th>ISP</th>
<td>{{$ipInfo->isp ?? 'N/A'}}</td>
</tr>
<tr>
<th>Organization (if any)</th>
<td>{{$ipInfo->organization ?? 'N/A'}}</td>
</tr>
<tr>
<th>C. Type</th>
<td>{{$ipInfo->connection_type ?? 'N/A'}}</td>
</tr>
<tr>
<th>Timezone</th>
<td>{{$ipInfo->time_zone->name ?? 'N/A'}}</td>
</tr>
</tbody>
</table>
@else
<div class="alert alert-danger">
<i class="fas fa-exclamation-circle"></i> <b>This query returned no results</b>
<p>
{{$ipInfo->message}}
</p>
</div>
@endif
<x-slot name="modalFooter"></x-slot>
</x-modal>
<x-modal id="editUser" modal-label="editUser" modal-title="Edit PII and Roles" include-close-button="true">
<form id="updateUserForm" method="post" action="{{ route('updateUser', ['user' => $profile->user->id]) }}">
@csrf
@method('PATCH')
<label for="email">Email address</label>
<input id="email" type="text" name="email" class="form-control" required value="{{ $profile->user->email }}" />
<label for="name">Name</label>
<input id="name" type="text" name="name" class="form-control" required value="{{ $profile->user->name }}" />
<label for="uuid">Mojang UUID</label>
<input id="uuid" type="text" name="uuid" class="form-control" required value="{{ $profile->user->uuid }}" />
<p class="text-muted text-sm">
<i class="fas fa-exclamation-triangle"></i> Warning! This is a sensitive setting! Changing this could have unintended consequences!
</p>
<div class="form-group mt-3">
<label>Roles</label>
<table class="table table-borderless">
<tbody>
@foreach($roles as $roleName => $status)
<tr>
<th><input type="checkbox" name="roles[]" value="{{ $roleName }}" {{ ($status) ? 'checked' : '' }}></th>
<td class="col-md-2">{{ ucfirst($roleName) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</form>
<x-slot name="modalFooter">
<button type="button" class="btn btn-warning" onclick="$('#updateUserForm').submit()"><i class="fa fa-exclamation-cicle"></i> Save changes</button>
</x-slot>
</x-modal>
@endif
<div class="row mb-3">
<div class="col">
<div class="text-center">
@if($profile->avatarPreference == 'gravatar')
<img class="profile-user-img img-fluid img-circle" src="https://gravatar.com/avatar/{{md5($profile->user->email)}}" alt="User profile picture">
@else
<img class="profile-user-img img-fluid img-circle" src="https://crafatar.com/avatars/{{$profile->user->uuid}}" alt="User profile picture">
@endif
</div>
</div>
</div>
<div class="row">
<div class="col-md-4 offset-md-4">
<div class="card">
<div class="card-body text-center">
@if ($profile->user->isBanned())
<del><h3>{{$profile->user->name}}</h3></del>
@else
<h3>{{$profile->user->name}}</h3>
@endif
<p class="text-muted">{{$profile->profileShortBio}}</p>
<p class="text-muted">Member since {{$since}}</p>
@if (Auth::user()->hasRole('admin'))
<button type="button" class="btn btn-sm btn-info" onclick="$('#ipInfo').modal('show')">Lookup {{$profile->user->originalIP}}</button>
@endif
@if ($profile->user->is(Auth::user()))
<button type="button" class="btn btn-sm btn-warning" onclick="window.location.href='{{route('showProfileSettings')}}'"><i class="fas fa-pencil-alt"></i></button>
@elseif (Auth::user()->hasRole('admin') && $profile->user->isStaffMember())
<button type="button" class="btn btn-sm btn-danger" onclick="$('#terminateUser').modal('show')">Terminate Staff Member</button>
@endif
</div>
<div class="card-footer text-center">
@foreach ($profile->user->roles as $role)
<span class="badge badge-success mr-2">{{ucfirst($role->name)}}</span>
@endforeach
</div>
</div>
</div>
@if (Auth::user()->hasRole('admin'))
<div class="col">
<div class="card">
<h5 class="card-header">
<a class="collapsed d-block" data-toggle="collapse" href="#collapse-collapsed" aria-expanded="true" aria-controls="collapse-collapsed" id="heading-collapsed">
<i class="fa fa-chevron-down pull-right"></i>
Account Management (Admin)
</a>
</h5>
<div id="collapse-collapsed" class="collapse" aria-labelledby="heading-collapsed">
<div class="card-body">
<div class="management-btn text-center">
@if (!$profile->user->isBanned())
<button class="btn btn-danger mb-2" id="banAccountTrigger"><i class="fa fa-ban"></i> Ban Account</button><br>
@else
<form method="post" action="{{route('unbanUser', ['user' => $profile->user->id])}}">
@method('DELETE')
@csrf
<button type="submit" class="btn btn-warning mb-2"><i class="fa fa-check"></i> Unban</button>
</form>
@endif
<button class="btn btn-danger mb-2" onclick="$('#deleteAccount').modal('show')"><i class="fas fa-trash-alt"></i> Delete Account</button><br>
<button class="btn btn-warning mb-2" onclick="$('#editUser').modal('show')"><i class="fas fa-pencil-alt"></i> Edit Account</button><br>
</div>
</div>
</div>
</div>
</div><!-- .col -->
@endif
</div>
<div class="row buttonBar">
<div class="col-md-4 offset-md-4">
<div class="card" style="border-radius: 50px">
<div class="card-body text-center">
<a href="https://github.com/{{$github}}" class="pr-2 pl-2"><i class="fab fa-github fa-2x"></i></a>
<a href="#" onclick="toastr.info('User\'s Discord tag: {{$discord}}')" class="pr-2 pl-2"><i class="fab fa-discord fa-2x"></i></a>
<a href="https://twitter.com/{{$twitter}}" class="pr-2 pl-2"><i class="fab fa-twitter fa-2x"></i></a>
<a href="https://instagram.com/{{$insta}}" class="pr-2 pl-2"><i class="fab fa-instagram fa-2x"></i></a>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="card">
<div class="card-header">
<h4>About</h4>
</div>
<div class="card-body">
{{$profile->profileAboutMe}}
</div>
</div>
</div>
</div>
@stop

View File

@@ -56,6 +56,12 @@
<h3 class="profile-username text-center">{{Auth::user()->name}}</h3>
<p class="text-muted text-center">{{$profile->profileShortBio}}</p>
<div class="text-center">
<button type="button" class="btn btn-sm btn-success" onclick="window.location.href='{{route('showSingleProfile', ['user' => Auth::user()->id])}}'"><i class="fas fa-eye"></i></button>
</div>
</div>
<div class="card-footer text-center">

View File

@@ -12,6 +12,7 @@
<link rel="stylesheet" href="/css/mixed.css">
<link rel="stylesheet" href="/css/viewapplication.css">
<link rel="stylesheet" href="/css/comments.css">
<!-- TODO: Move to Mix + Webpack -->
@@ -21,8 +22,7 @@
<script type="text/javascript" src="/js/app.js"></script>
<x-global-errors></x-global-errors>
@if (!$canVote)
@if (!$canVote && Auth::user()->can('applications.vote') && $application->applicationStatus == 'STAGE_PEERAPPROVAL')
<script>
toastr.info('You cannot vote on this application anymore.', 'Warning')
</script>
@@ -32,37 +32,48 @@
@section('content')
<x-modal id="notes" modal-label="notes" modal-title="Shared Notepad" include-close-button="true">
@if (!is_null($application->appointment))
<form id="meetingNotes" method="POST" action="{{route('saveNotes', ['applicationID' => $application->id])}}">
@csrf
@method('PATCH')
<textarea name="noteText" rows="5" class="form-control">{{$application->appointment->meetingNotes ?? 'There are no notes yet. Add some!'}}</textarea>
</form>
<p class="text-muted text-sm">Last updated @ {{$application->appointment->updated_at}}</p>
@canany('applications.view.all', 'appointments.*')
<x-slot name="modalFooter">
<button type="button" class="btn btn-success" onclick="document.getElementById('meetingNotes').submit()"><i class="far fa-paper-plane"></i> Save & Close</button>
</x-slot>
</x-modal>
<x-modal id="notes" modal-label="notes" modal-title="Shared Notepad" include-close-button="true">
<x-modal id="denyApplication" modal-label="denyApplicationLabel" modal-title="Please confirm" include-close-button="true">
<form id="meetingNotes" method="POST" action="{{route('saveNotes', ['applicationID' => $application->id])}}">
@csrf
@method('PATCH')
<textarea name="noteText" rows="5" class="form-control">{{$application->appointment->meetingNotes ?? 'There are no notes yet. Add some!'}}</textarea>
</form>
<p class="text-muted text-sm">Last updated @ {{$application->appointment->updated_at}}</p>
<p>Are you sure you want to deny this application? Please keep in mind that this user will only be allowed to apply 30 days after their first application.</p>
<p class="text-muted">This action cannot be undone.</p>
<x-slot name="modalFooter">
<button type="button" class="btn btn-success" onclick="document.getElementById('meetingNotes').submit()"><i class="far fa-paper-plane"></i> Save & Close</button>
</x-slot>
</x-modal>
<x-slot name="modalFooter">
@endcanany
@endif
<form id="updateApplication" action="{{route('updateApplicationStatus', ['id' => $application->id, 'newStatus' => 'deny'])}}" method="POST">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-danger">Confirm: Deny Applicant</button>
</form>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
@role('hiringManager')
</x-slot>
<x-modal id="denyApplication" modal-label="denyApplicationLabel" modal-title="Please confirm" include-close-button="true">
</x-modal>
<p>Are you sure you want to deny this application? Please keep in mind that this user will only be allowed to apply 30 days after their first application.</p>
<p class="text-muted">This action cannot be undone.</p>
<x-slot name="modalFooter">
<form id="updateApplication" action="{{route('updateApplicationStatus', ['id' => $application->id, 'newStatus' => 'deny'])}}" method="POST">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-danger">Confirm: Deny Applicant</button>
</form>
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</x-slot>
</x-modal>
@endhasrole
<div class="row">
@@ -91,6 +102,7 @@
</div>
<!-- TODO: Simplify logic by using switches, as well as a single Gate check -->
<div class="col">
<div class="row">
@@ -106,7 +118,9 @@
<div class="card-body">
<p><b>Applicant Name: </b> <span class="badge badge-primary">{{$application->user->name}}</span></p>
<p><b>Applicant IP Address:</b> <span class="badge badge-primary">{{$application->user->originalIP}}</span></p>
@if (Auth::user()->hasRole('hiringManager'))
<p><b>Applicant IP Address:</b> <span class="badge badge-primary">{{$application->user->originalIP}}</span></p>
@endif
<p><b>Applied On:</b> <span class="badge badge-primary">{{$application->created_at}}</span></p>
<p><b>Last acted on:</b><span class="badge badge-primary">{{$application->updated_at}}</span></p>
<p><b>Applying for:</b> <span class="badge badge-primary">{{$vacancy->vacancyName}}</span></p>
@@ -155,7 +169,7 @@
<div class="col">
@if ($application->applicationStatus == 'STAGE_SUBMITTED')
@if ($application->applicationStatus == 'STAGE_SUBMITTED' && Auth::user()->hasRole('hiringManager'))
<div class="card bg-gray">
<div class="card-header bg-gradient-gray">
@@ -192,7 +206,7 @@
</div>
@if ($application->applicationStatus == 'STAGE_INTERVIEW')
@if ($application->applicationStatus == 'STAGE_INTERVIEW' && Auth::user()->hasRole('hiringManager'))
<div class="row">
@@ -259,15 +273,18 @@
<x-slot name="cardFooter">
<form class="footer-button" action="{{route('updateAppointment', ['applicationID' => $application->id, 'status' => 'concluded'])}}" method="POST">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-success">Finish Meeting</button>
</form>
<button class="btn btn-warning mr-3">View Meeting Notes</button>
@can('appointments.schedule.edit')
<form style="white-space: nowrap;display:inline-block" class="footer-button" action="{{route('updateAppointment', ['applicationID' => $application->id, 'status' => 'concluded'])}}" method="POST">
@csrf
@method('PATCH')
<button type="submit" class="btn btn-success">Finish Meeting</button>
</form>
@endcan
@can('applications.vote')
<button class="btn btn-warning mr-3" onclick="$('#notes').modal('show')">View Meeting Notes</button>
@endcan
<!-- Show to users only -->
<button class="btn btn-success mr-3">Accept Meeting</button>
</x-slot>
</x-card>
@@ -278,7 +295,7 @@
@endif
@if ($application->applicationStatus = 'STAGE_PEERAPPROVAL')
@if ($application->applicationStatus == 'STAGE_PEERAPPROVAL' && Auth::user()->can('applications.vote'))
<x-card id="peerApproval" card-title="Vote on this Application" footer-style="text-center">
@@ -313,19 +330,162 @@
@endif
<div class="row">
@can('applications.view.all')
<div class="col text-center">
<div class="row">
<button type="button" class="btn btn-primary" onclick="window.location.href='{{route('staffPendingApps')}}'">View more Applications</button>
<div class="col text-center">
<button type="button" class="btn btn-primary" onclick="window.location.href='{{route('staffPendingApps')}}'">View more Applications</button>
</div>
</div>
</div>
@endcan
</div>
</div>
@hasanyrole('reviewer|hiringManager|admin')
@if (!Auth::user()->is($application->user))
<div class="row mb-3 mt-2">
<h3>Comments ({{$comments->count()}})</h3>
</div>
<div class="row">
<div class="col">
@if ($comments->isEmpty())
<div class="alert alert-warning">
<i class="fas fa-question"></i> <b>Such wow, much empty</b>
<p>There are no comments here! Comments are only visible to staff members. Be the first to share your input!</p>
<p>Commenting may help with decision-making when time comes to vote for an application.</p>
</div>
@endif
</div>
</div>
@if (!$comments->isEmpty())
@foreach($comments as $comment)
<div class="row mt-3 mb-3">
<div class="col-md-2">
<div class="text-center">
@if($application->user->avatarPreference == 'gravatar')
<img class="profile-user-img img-fluid img-circle" src="https://gravatar.com/avatar/{{md5($comment->user->email)}}" alt="User profile picture">
@else
<img class="profile-user-img img-fluid img-circle" src="https://crafatar.com/avatars/{{$comment->user->uuid}}" alt="User profile picture">
@endif
</div>
</div>
<div class="card comment">
<div class="card-header comment-header">
<h1 class="commenter">{{$comment->user->name}} &#9679; {{Carbon\Carbon::parse($comment->created_at)->diffForHumans()}}</h3>
</div>
<div class="card-body">
{{$comment->text}}
</div>
@if(Auth::user()->is($comment->user) || Auth::user()->hasRole('admin'))
<div class="card-footer comment-footer">
<form method="POST" id="deleteComment" action="{{route('deleteApplicationComment', ['comment' => $comment->id])}}">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-outline-danger"><i class="fas fa-trash-alt"></i></button>
</form>
</div>
@endif
</div>
</div>
@endforeach
@endif
<!-- display comments here -->
<div class="row mt-5">
<div class="col-md-2">
<div class="text-center">
@if($application->user->avatarPreference == 'gravatar')
<img class="profile-user-img img-fluid img-circle" src="https://gravatar.com/avatar/{{md5(Auth::user()->email)}}" alt="User profile picture">
@else
<img class="profile-user-img img-fluid img-circle" src="https://crafatar.com/avatars/{{Auth::user()->uuid}}" alt="User profile picture">
@endif
</div>
</div>
<div class="col">
<div class="card border-top border-bottom">
<div class="card-body">
<form id="newComment" method="POST" action="{{route('addApplicationComment', ['application' => $application->id])}}">
@csrf
<textarea id="comment" name="comment" class="form-control" id="commentText"></textarea>
</form>
<div class="row">
<div class="col text-left">
<p class="text-sm text-muted">Commenting as {{Auth::user()->name}}</p>
</div>
<div class="col text-right">
<p class="text-sm text-muted"><span id="charcount">0</span>/600 max characters</p>
</div>
</div>
</div>
<div class="card-footer text-right">
<button type="button" id="submitComment" class="btn btn-sm btn-secondary">Post</button>
</div>
</div>
</div>
</div>
@endif
@endhasanyrole
@endsection