@extends('layouts.app') @section('title', 'Training') @section('title-flex')
@can('close', $training) Close my training @endcan
@endsection @section('content') @if($training->status < \App\Helpers\TrainingStatus::COMPLETED->value && $training->status != \App\Helpers\TrainingStatus::CLOSED_BY_STUDENT->value) @endif @if($training->status == \App\Helpers\TrainingStatus::CLOSED_BY_STUDENT->value) @endif
 {{ $training->user->first_name }}'s training for @foreach($training->ratings as $rating) @if ($loop->last) {{ $rating->name }} @else {{ $rating->name . " + " }} @endif @endforeach
@can('create', [\App\Models\Task::class]) @endcan
State
status]["color"] }}"> {{ $statuses[$training->status]["text"] }}{{ isset($training->paused_at) ? ' (PAUSED)' : '' }}
Type
 {{ $types[$training->type]["text"] }}
Level
@if ( is_iterable($ratings = $training->ratings->toArray()) ) @for( $i = 0; $i < sizeof($ratings); $i++ ) @if ( $i == (sizeof($ratings) - 1) ) {{ $ratings[$i]["name"] }} @else {{ $ratings[$i]["name"] . " + " }} @endif @endfor @else {{ $ratings["name"] }} @endif
Vatsim ID
{{ $training->user->id }} @if($training->user->division == 'EUD') @endif
Name
{{ $training->user->name }}
Area
{{ $training->area->name }}
Mentor
{{ !empty($training->getInlineMentors()) ? $training->getInlineMentors() : '-' }}
Period
@if ($training->started_at == null && $training->closed_at == null) Training not started @elseif ($training->closed_at == null) {{ $training->started_at->toEuropeanDate() }} - @elseif ($training->started_at != null) {{ $training->started_at->toEuropeanDate() }} - {{ $training->closed_at->toEuropeanDate() }} @else N/A @endif
Applied
{{ $training->created_at->toEuropeanDate() }}
Closed
@if ($training->closed_at != null) {{ $training->closed_at->toEuropeanDate() }} @else - @endif
@can('edit', [\App\Models\Training::class, $training])  Edit training @endcan
@can('update', $training)
@method('PATCH') @csrf
@if($activeTrainingInterest) @endif
paused_at ? "checked" : "" }} @if(!Auth::user()->isModeratorOrAbove()) disabled @endif>

@if (\Auth::user()->isModeratorOrAbove())
@endif
@endcan
Timeline
@can('comment', [\App\Models\TrainingActivity::class, \App\Models\Training::find($training->id)])
@csrf
@endcan
    @foreach($activities as $activity) @can('view', [\App\Models\TrainingActivity::class, \App\Models\Training::find($training->id), $activity->type])
  • @if($activity->type == "STATUS" || $activity->type == "TYPE") @elseif($activity->type == "MENTOR") @if($activity->new_data) @elseif($activity->old_data) @endif @elseif($activity->type == "PAUSE") @elseif($activity->type == "ENDORSEMENT") @elseif($activity->type == "COMMENT") @endif @isset($activity->triggered_by_id) {{ \App\Models\User::find($activity->triggered_by_id)->name }} — @endisset {{ $activity->created_at->toEuropeanDateTime() }} @can('comment', [\App\Models\TrainingActivity::class, \App\Models\Training::find($training->id)]) @if($activity->type == "COMMENT" && now() <= $activity->created_at->addDays(1) && $activity->triggered_by_id == \Auth::user()->id) @endif @endcan

    @if($activity->type == "STATUS") @if(($activity->new_data == -2 || $activity->new_data == -4) && isset($activity->comment)) Status changed from {{ \App\Http\Controllers\TrainingController::$statuses[$activity->old_data]["text"] }} to {{ \App\Http\Controllers\TrainingController::$statuses[$activity->new_data]["text"] }} with reason {{ $activity->comment }} @else Status changed from {{ \App\Http\Controllers\TrainingController::$statuses[$activity->old_data]["text"] }} to {{ \App\Http\Controllers\TrainingController::$statuses[$activity->new_data]["text"] }} @endif @elseif($activity->type == "TYPE") Training type changed from {{ \App\Http\Controllers\TrainingController::$types[$activity->old_data]["text"] }} to {{ \App\Http\Controllers\TrainingController::$types[$activity->new_data]["text"] }} @elseif($activity->type == "MENTOR") @if($activity->new_data) {{ \App\Models\User::find($activity->new_data)->name }} assigned as mentor @elseif($activity->old_data) {{ \App\Models\User::find($activity->old_data)->name }} removed as mentor @endif @elseif($activity->type == "PAUSE") @if($activity->new_data) Training paused @else Training unpaused @endif @elseif($activity->type == "ENDORSEMENT") @if(\App\Models\Endorsement::find($activity->new_data) !== null) @empty($activity->comment) {{ str(\App\Models\Endorsement::find($activity->new_data)->type)->lower()->ucfirst() }} endorsement granted, valid to @isset(\App\Models\Endorsement::find($activity->new_data)->valid_to) {{ \App\Models\Endorsement::find($activity->new_data)->valid_to->toEuropeanDateTime() }} @else Forever @endisset @else {{ str(\App\Models\Endorsement::find($activity->new_data)->type)->lower()->ucfirst() }} endorsement granted, valid to @isset(\App\Models\Endorsement::find($activity->new_data)->valid_to) {{ \App\Models\Endorsement::find($activity->new_data)->valid_to->toEuropeanDateTime() }} @else Forever @endisset for positions: @foreach(explode(',', $activity->comment) as $p) {{ $p }} @endforeach @endempty @endif @elseif($activity->type == "COMMENT") {!! nl2br($activity->comment) !!} @if($activity->created_at != $activity->updated_at) (edited) @endif @endif

  • @endcan @endforeach
  • @isset($training->created_by) {{ \App\Models\User::find($training->created_by)->name }} — @endisset {{ $training->created_at->toEuropeanDateTime() }}

    Training created

Application
@if($training->english_only_training)   Requesting training in English only
@else   Requesting training in local language or English
@endif @isset($training->experience)   {{ $experiences[$training->experience]["text"] }} @endisset

 Letter of motivation

@if(empty($training->motivation))

Not provided / relevant

@else

{{ $training->motivation }}

@endif
@if($training->status >= \App\Helpers\TrainingStatus::PRE_TRAINING->value && $training->status <= \App\Helpers\TrainingStatus::AWAITING_EXAM->value)
@else
@endif Training Reports
@if( \Auth::user()->can('create', [\App\Models\OneTimeLink::class, $training, \App\Models\OneTimeLink::TRAINING_REPORT_TYPE]) || \Auth::user()->can('create', [\App\Models\OneTimeLink::class, $training, \App\Models\OneTimeLink::TRAINING_EXAMINATION_TYPE]) || ($training->status >= \App\Helpers\TrainingStatus::PRE_TRAINING->value && $training->status <= \App\Helpers\TrainingStatus::AWAITING_EXAM->value) ) @endif
@can('viewAny', [\App\Models\TrainingReport::class, $training])
@if ($reportsAndExams->count() == 0)
No training reports yet.
@else @foreach($reportsAndExams as $reportModel) @if(is_a($reportModel, '\App\Models\TrainingReport')) @if(!$reportModel->draft || $reportModel->draft && \Auth::user()->isMentorOrAbove()) @php $uuid = "instance-".Ramsey\Uuid\Uuid::uuid4(); @endphp
@if(isset($reportModel->position)) {{ $reportModel->position }}  @endif {{ isset(\App\Models\User::find($reportModel->written_by_id)->name) ? \App\Models\User::find($reportModel->written_by_id)->name : "Unknown" }} @can('update', $reportModel) Edit @endcan
@markdown($reportModel->content)
@if(isset($reportModel->contentimprove) && !empty($reportModel->contentimprove))

 Areas to improve

@markdown($reportModel->contentimprove)
@endif @if($reportModel->attachments->count() > 0)
@foreach($reportModel->attachments as $attachment) @endforeach @endif
@endif @else @php $uuid = "instance-".Ramsey\Uuid\Uuid::uuid4(); @endphp
@if(isset($reportModel->position)) {{ \App\Models\Position::find($reportModel->position_id)->callsign }}  @endif {{ isset(\App\Models\User::find($reportModel->examiner_id)->name) ? \App\Models\User::find($reportModel->examiner_id)->name : "Unknown" }} @can('delete', [\App\Models\TrainingExamination::class, $reportModel]) Delete @endcan
@if($reportModel->result == "PASSED") PASSED @elseif($reportModel->result == "FAILED") FAILED @elseif($reportModel->result == "INCOMPLETE") INCOMPLETE @elseif($reportModel->result == "POSTPONED") POSTPONED @endif
@if($reportModel->attachments->count() > 0) @foreach($reportModel->attachments as $attachment) @endforeach @endif
@endif @endforeach @endif
@else
You don't have access to see the training reports.
@endcan
Training Interest Confirmations
@if($trainingInterests->count() == 0)

No confirmation history

@else
@foreach($trainingInterests as $interest) @endforeach
Interest sent Confirmation Deadline Interest confirmed
{{ $interest->created_at->toEuropeanDate() }} {{ $interest->deadline->toEuropeanDate() }} @if($interest->confirmed_at)  {{ $interest->confirmed_at->toEuropeanDate() }} @elseif($interest->expired) @if($interest->expired == 1)  Invalidated @else  Not confirmed @endif @else  Awaiting confirmation @endif
@endif
Related Tasks
@if($relatedTasks->count() == 0)

No related task history

@else
@foreach($relatedTasks as $task) @endforeach
Task Creator Assignee Status
{{ $task->type()->getText($task) }} {{ $task->creator->name }} {{ $task->assignee->name }} @if($task->status == \App\Helpers\TaskStatus::COMPLETED) @elseif($task->status == \App\Helpers\TaskStatus::DECLINED) @elseif($task->status == \App\Helpers\TaskStatus::PENDING) @endif @if($task->status == \App\Helpers\TaskStatus::COMPLETED || $task->status == \App\Helpers\TaskStatus::DECLINED) {{ $task->closed_at->diffForHumans() }} @else {{ $task->created_at->diffForHumans() }} @endif
@endif
@foreach($requestTypes as $requestType) @if($requestType->allowNonVatsimRatings() == true || ($requestType->allowNonVatsimRatings() == false && $training->hasVatsimRatings() == true)) @include('training.parts.taskmodal', ['requestType' => $requestType, 'training' => $training]) @endif @endforeach @endsection @section('js') @endsection