2020-05-03 04:04:26 +00:00
|
|
|
@extends('adminlte::page')
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
@section('title', config('app.name') . ' | ' . __('messages.open_positions'))
|
2020-05-03 04:04:26 +00:00
|
|
|
|
|
|
|
@section('content_header')
|
|
|
|
|
2020-07-12 16:01:33 +00:00
|
|
|
@if (Auth::user()->hasAnyRole('admin', 'hiringManager'))
|
2020-09-01 11:43:39 +00:00
|
|
|
<h4>{{__('messages.adm')}} / {{__('messages.open_positions')}}</h4>
|
2020-07-12 16:01:33 +00:00
|
|
|
@else
|
2020-09-01 11:43:39 +00:00
|
|
|
<h4>{{__('messages.reusable.no_access')}}</h4>
|
2020-07-12 16:01:33 +00:00
|
|
|
@endif
|
2020-05-03 04:04:26 +00:00
|
|
|
|
|
|
|
@stop
|
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
@section('js')
|
|
|
|
|
|
|
|
@if (session()->has('success'))
|
|
|
|
|
|
|
|
<script>
|
|
|
|
toastr.success("{{session('success')}}")
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@elseif(session()->has('error'))
|
|
|
|
<script>
|
|
|
|
toastr.error("{{session('error')}}")
|
|
|
|
</script>
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@if($errors->any())
|
|
|
|
|
|
|
|
@foreach ($errors->all() as $error)
|
2020-09-01 11:43:39 +00:00
|
|
|
<script>toastr.error('{{$error}}', '{{__('messages.reusable.validation_err')}}')</script>
|
2020-05-07 23:24:56 +00:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
@stop
|
|
|
|
|
2020-05-03 04:04:26 +00:00
|
|
|
@section('content')
|
2020-07-12 16:01:33 +00:00
|
|
|
@if (Auth::user()->hasAnyRole('admin', 'hiringManager'))
|
2020-07-11 19:34:26 +00:00
|
|
|
<!-- todo: switch to modal component -->
|
2020-05-07 23:24:56 +00:00
|
|
|
<div class="modal fade" tabindex="-1" id="newVacancyForm" role="dialog" aria-labelledby="modalFormLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
2020-09-01 11:43:39 +00:00
|
|
|
<h5 class="modal-title" id="modalFormLabel">{{__('messages.new_vacancy')}}</h5>
|
2020-05-07 23:24:56 +00:00
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
|
|
|
|
@if(!$forms->isEmpty())
|
|
|
|
|
|
|
|
<form id="savePositionForm" action="{{route('savePosition')}}" method="POST">
|
|
|
|
@csrf
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="vacancyName">{{__('messages.vacancy.name')}}</label>
|
2020-05-07 23:24:56 +00:00
|
|
|
<input type="text" id="vacancyName" name="vacancyName" class="form-control">
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="vacancyDescription">{{__('messages.vacancy.description')}}</label>
|
2020-05-07 23:24:56 +00:00
|
|
|
<input type="text" id="vacancyDescription" name="vacancyDescription" class="form-control">
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="vacancyFullDescription">{{__('messages.vacancy.description')}}</label>
|
|
|
|
<textarea name="vacancyFullDescription" class="form-control" rel="txtTooltip" title="{{__('messages.vacancy.description_tooltip')}}" data-toggle="tooltip" data-placement="bottom"></textarea>
|
|
|
|
<span class="right text-muted"><i class="fab fa-markdown"></i> {{__('messages.vacancy.markdown')}}</span>
|
2020-05-07 23:24:56 +00:00
|
|
|
<div class="row mt-3">
|
|
|
|
|
|
|
|
<div class="col">
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="pgroup">{{__('messages.vacancy.permission_group')}}</label>
|
|
|
|
<input rel="txtTooltip" title="{{__('messages.vacancy.permission_group_tooltip')}}" data-toggle="tooltip" data-placement="bottom" type="text" id="pgroup" name="permissionGroup" class="form-control">
|
2020-05-07 23:24:56 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col">
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="discordrole">{{__('messages.vacancy.discord_roleid')}} (*)</label>
|
|
|
|
<input rel="txtTooltip" title="{{__('messages.vacancy.discord_roleid_tooltip')}}" data-toggle="tooltip" data-placement="bottom" type="text" id="discordrole" name="discordRole" class="form-control">
|
2020-05-07 23:24:56 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="form-group mt-4">
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="associatedForm">{{__('messages.positions_p.application_form')}}</label>
|
2020-05-07 23:24:56 +00:00
|
|
|
<select class="custom-select" name="vacancyFormID" id="associatedForm">
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<option disabled>{{__('messages.positions_p.select_form')}}</option>
|
2020-05-07 23:24:56 +00:00
|
|
|
@foreach($forms as $form)
|
|
|
|
|
|
|
|
<option value="{{$form->id}}">{{$form->formName}}</option>
|
|
|
|
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<label for="vacancyCount">{{__('messages.vacancy.free_slots')}}</label>
|
|
|
|
<input rel="txtTooltip" title="{{__('messages.vacancy.free_slots_tooltip')}}" data-toggle="tooltip" data-placement="bottom" type="text" id="vacancyCount" name="vacancyCount" class="form-control">
|
2020-05-07 23:24:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
@else
|
|
|
|
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
|
|
|
|
<p>
|
2020-09-01 11:43:39 +00:00
|
|
|
{{__('messages.positions_p.no_form_error')}}
|
2020-05-07 23:24:56 +00:00
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="modal-footer">
|
|
|
|
|
|
|
|
@if(!$forms->isEmpty())
|
2020-09-01 11:43:39 +00:00
|
|
|
<button type="button" class="btn btn-primary" onclick="document.getElementById('savePositionForm').submit()">{{__('messages.vacancy.add')}}</button>
|
2020-05-07 23:24:56 +00:00
|
|
|
@endif
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{__('messages.modal_close')}}</button>
|
2020-05-07 23:24:56 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-05-03 04:04:26 +00:00
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col-md-4 offset-md-4 text-center">
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<button type="button" class="btn btn-primary" onclick="$('#newVacancyForm').modal('show')">{{__('messages.positions_p.new_pos')}}</button>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
<div class="col">
|
|
|
|
|
|
|
|
<div class="card bg-gray-dark">
|
|
|
|
|
|
|
|
<div class="card-header bg-indigo">
|
2020-09-01 11:43:39 +00:00
|
|
|
<div class="card-title"><h4 class="text-bold">{{__('messages.open_positions')}}</h4></div>
|
2020-05-03 04:04:26 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
@if(!$vacancies->isEmpty())
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
<table class="table table-active table-borderless" style="white-space: nowrap">
|
|
|
|
|
|
|
|
<thead>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
|
|
|
<tr>
|
2020-09-01 11:43:39 +00:00
|
|
|
<th>{{__('messages.contactlabel_name')}}</th>
|
|
|
|
<th>{{__('messages.reusable.description')}}</th>
|
|
|
|
<th>{{__('messages.vacancy.discord_roleid')}}</th>
|
|
|
|
<th>{{__('messages.vacancy.permission_groupr')}}</th>
|
|
|
|
<th>{{__('messages.vacancy.free_slots')}}</th>
|
|
|
|
<th>{{__('messages.reusable.status')}}</th>
|
|
|
|
<th>{{__('messages.reusable.created_at')}}</th>
|
|
|
|
<th>{{__('messages.reusable.actions')}}</th>
|
2020-05-03 04:04:26 +00:00
|
|
|
</tr>
|
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
</thead>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
<tbody>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
@foreach($vacancies as $vacancy)
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>{{$vacancy->vacancyName}}</td>
|
2020-05-08 00:45:29 +00:00
|
|
|
<td>{{substr($vacancy->vacancyDescription, 0, 20)}}...</td>
|
2020-05-07 23:24:56 +00:00
|
|
|
<td><span class="badge badge-success">{{$vacancy->discordRoleID}}</span></td>
|
|
|
|
<td><span class="badge badge-success">{{$vacancy->permissionGroupName}}</span></td>
|
|
|
|
<td>{{$vacancy->vacancyCount}}</td>
|
|
|
|
@if($vacancy->vacancyStatus == 'OPEN')
|
2020-09-01 11:43:39 +00:00
|
|
|
<td><span class="badge badge-success">{{__('messages.open')}}</span></td>
|
2020-05-07 23:24:56 +00:00
|
|
|
@else
|
2020-09-01 11:43:39 +00:00
|
|
|
<td><span class="badge badge-danger">{{__('messages.closed')}}</span></td>
|
2020-05-07 23:24:56 +00:00
|
|
|
@endif
|
|
|
|
<td>{{$vacancy->created_at}}</td>
|
|
|
|
<td>
|
2020-07-11 19:34:26 +00:00
|
|
|
|
|
|
|
<button type="button" class="btn btn-sm btn-warning" onclick="window.location.href='{{ route('editPosition', ['position' => $vacancy->id]) }}'"><i class="fas fa-edit"></i></button>
|
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
@if ($vacancy->vacancyStatus == 'OPEN')
|
|
|
|
|
2020-07-16 20:21:28 +00:00
|
|
|
<form action="{{route('updatePositionAvailability', ['status' => 'close', 'vacancy' => $vacancy->id])}}" method="POST" id="closePosition" style="display: inline">
|
2020-05-07 23:24:56 +00:00
|
|
|
@csrf
|
|
|
|
@method('PATCH')
|
2020-07-11 19:34:26 +00:00
|
|
|
<button type="submit" class="btn btn-sm btn-danger"><i class="fa fa-ban"></i></button>
|
2020-05-07 23:24:56 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
@else
|
|
|
|
|
2020-07-16 20:21:28 +00:00
|
|
|
<form action="{{route('updatePositionAvailability', ['status' => 'open', 'vacancy' => $vacancy->id])}}" method="POST" id="openPosition" style="display: inline">
|
2020-05-07 23:24:56 +00:00
|
|
|
@csrf
|
|
|
|
@method('PATCH')
|
2020-07-11 19:34:26 +00:00
|
|
|
<button type="submit" class="btn btn-sm btn-success"><i class="fa fa-check"></i></button>
|
2020-05-07 23:24:56 +00:00
|
|
|
</form>
|
|
|
|
|
|
|
|
@endif
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
@endforeach
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
|
|
|
|
</table>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
@else
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
<div class="alert alert-warning">
|
2020-09-01 11:43:39 +00:00
|
|
|
<p>{{__('messages.positions_p.empty_pos_warning')}}</p>
|
2020-05-07 23:24:56 +00:00
|
|
|
</div>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
2020-05-07 23:24:56 +00:00
|
|
|
@endif
|
2020-05-03 04:04:26 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="card-footer">
|
|
|
|
|
2020-09-01 11:43:39 +00:00
|
|
|
<button type="button" class="btn btn-outline-primary" onclick="window.location.href='{{route('showForms')}}'">{{__('messages.positions_p.manage_forms')}}</button>
|
2020-05-03 04:04:26 +00:00
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2020-07-12 16:01:33 +00:00
|
|
|
@else
|
|
|
|
<x-no-permission type="danger"></x-no-permission>
|
|
|
|
@endif
|
2020-05-03 04:04:26 +00:00
|
|
|
@stop
|
2020-07-16 05:46:20 +00:00
|
|
|
|
|
|
|
@section('footer')
|
|
|
|
@include('breadcrumbs.dashboard.footer')
|
|
|
|
@stop
|