Add LOA feature, improve components
This commit is contained in:
119
resources/views/dashboard/absences/create.blade.php
Normal file
119
resources/views/dashboard/absences/create.blade.php
Normal file
@@ -0,0 +1,119 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', config('app.name') . ' | ' . __('Member absence request'))
|
||||
|
||||
@section('content_header')
|
||||
|
||||
<h4>{{__('Human Resources')}} / {{ __('Staff') }} / {{__('Absence request')}}</h4>
|
||||
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
|
||||
<x-global-errors></x-global-errors>
|
||||
|
||||
<script>
|
||||
$('#startDate').flatpickr(
|
||||
{
|
||||
enableTime: false,
|
||||
dateFormat: 'Y-m-d',
|
||||
static: false
|
||||
}
|
||||
)
|
||||
$('#predictedEnd').flatpickr(
|
||||
{
|
||||
enableTime: false,
|
||||
dateFormat: 'Y-m-d',
|
||||
static: false
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col">
|
||||
|
||||
<form name="submitAbsenceRequest" method="post" action="{{ route('absences.store') }}">
|
||||
@csrf
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header">
|
||||
<h4 class="card-title">{{ __('Leave of absence') }}</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
@if ($activeRequest)
|
||||
<x-alert alert-type="danger" icon="fa-exclamation-triangle" title="{{ __('Submissions locked!') }}">
|
||||
{{ __('Sorry, but you already have an active leave of absence request. Please cancel (or let expire) your previous request before attempting to make a new one.') }}
|
||||
</x-alert>
|
||||
@endif
|
||||
|
||||
<div class="form-group">
|
||||
<label for="reason"><i class="fas fa-clipboard"></i> {{ __('Request reason') }}</label>
|
||||
<input {{ ($activeRequest) ? 'disabled' : '' }} id="reason" name="reason" type="text" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<label for="start_date"><i class="far fa-clock"></i> {{ __('Absence start date') }}</label>
|
||||
<input {{ ($activeRequest) ? 'disabled' : '' }} type="text" name="start_date" id="startDate" class="form-control" required>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<label for="predicted_end"><i class="fas fa-history"></i> {{ __('Predicted end') }}</label>
|
||||
<input {{ ($activeRequest) ? 'disabled' : '' }} type="text" name="predicted_end" id="predictedEnd" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<input type="hidden" name="available_assist" value="off">
|
||||
<label><input {{ ($activeRequest) ? 'disabled' : '' }} type="checkbox" name="available_assist"> {{ __('Will you be available to assist occasionally during your absence?') }}</label>
|
||||
|
||||
<input type="hidden" name="invalidAbsenceAgreement" value="off">
|
||||
<label><input {{ ($activeRequest) ? 'disabled' : '' }} type="checkbox" name="invalidAbsenceAgreement"> {{ __('I understand that inactivity/no-show after a declined/expired absence request will be treated according to standard procedure.') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<x-button disabled="{{ (bool) $activeRequest }}" id="btnSubmitRequest" type="submit" color="success" icon="fas fa-paper-plane">
|
||||
{{ __('Submit for approval') }}
|
||||
</x-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<x-alert alert-type="info" title="{{ __('How to request a leave of absence') }}" icon="fa-info-circle">
|
||||
|
||||
<p>{{ __('A leave of absence allows you to step away from your duties for a period of time. To request one, simply fill the form to your left, and enter the reason for which you\'re stepping away. You will also need to specify when you will be unavailable, and when you predict to be back.') }}</p
|
||||
<p>{{ __('You will also need to agree to the terms of a LOA. Additionally, you may also specify whether you\'ll be available to chat occasionally during your absence, but not perform your full duties.') }}</p>
|
||||
<p>{{ __('You may only have one active request at the same time, which will have to be either approved or declined by the admins. Please keep in mind that you will not be able to delete any of your requests.') }}</p>
|
||||
</x-alert>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<x-button id="btnCancelRequest" color="info" icon="fas fa-info-circle">
|
||||
{{ __('Cancel request') }}
|
||||
</x-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
115
resources/views/dashboard/absences/index.blade.php
Normal file
115
resources/views/dashboard/absences/index.blade.php
Normal file
@@ -0,0 +1,115 @@
|
||||
@extends('adminlte::page')
|
||||
|
||||
@section('title', config('app.name') . ' | ' . __('Member absence management'))
|
||||
|
||||
@section('content_header')
|
||||
|
||||
<h4>{{__('Human Resources')}} / {{ __('Admin') }} / {{__('Absence management')}}</h4>
|
||||
|
||||
@stop
|
||||
|
||||
@section('js')
|
||||
|
||||
<x-global-errors></x-global-errors>
|
||||
|
||||
@stop
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
|
||||
<x-alert alert-type="info">
|
||||
<p class="text-bold"><i class="fas fa-info-circle"></i> {{ __('What is a leave of absence?') }}</p>
|
||||
|
||||
<p>{{ __('A leave of absence is a time period in which an employee takes personal time off, for a multitude of reasons. It\'s a prolonged, authorized absence form work and/or other duties, communicated in advance, usually via letter or via an HR system.') }}</p>
|
||||
|
||||
<p>{{ __('Here, you\'ll be able to view and approve leave requests from staff members. Notifications are sent out to ensure the right people know about this leave in advance. Staff members may ignore declined leave requests, however, their time off will be considered as a period of inactivity (no-show).') }}</p>
|
||||
</x-alert>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col">
|
||||
<div class="card bg-gray-dark">
|
||||
|
||||
<div class="card-header bg-indigo">
|
||||
|
||||
<div class="card-title"><h4 class="text-bold">{{__('Leave of absence requests')}}</h4></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (true)
|
||||
<table class="table table-borderless table-active">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{__('Requesting user')}}</th>
|
||||
<th>{{__('Reviewing admin')}}</th>
|
||||
<th>{{ __('Status') }}</th>
|
||||
<th>{{ __('Request date') }}</th>
|
||||
<th>{{ __('Actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($absences as $absence)
|
||||
<tr>
|
||||
<td>{{ $absence->requester->name }}</td>
|
||||
<td><span class="badge badge-warning"><i class="fas fa-exclamation-circle"></i> {{ __('None yet') }}</span></td>
|
||||
<td>
|
||||
@switch($absence->status)
|
||||
|
||||
@case('PENDING')
|
||||
<span class="badge badge-warning"><i class="fas fa-clock"></i> {{ __('Pending') }}</span>
|
||||
@break
|
||||
|
||||
@case('APPROVED')
|
||||
<span class="badge badge-success"><i class="far fa-thumbs-up"></i> {{ __('Approved') }}</span>
|
||||
@break
|
||||
|
||||
@case('DECLINED')
|
||||
<span class="badge badge-danger"><i class="far fa-thumbs-down"></i> {{ __('Declined') }}</span>
|
||||
@break
|
||||
|
||||
@case('CANCELLED')
|
||||
<span class="badge badge-secondary"><i class="fas fa-ban"></i> {{ __('Cancelled') }}</span>
|
||||
@break
|
||||
|
||||
@case('ENDED')
|
||||
<span class="badge badge-info"><i class="fas fa-history"></i> {{ __('Ended') }}</span>
|
||||
@break
|
||||
@endswitch
|
||||
</td>
|
||||
<td>{{ $absence->created_at }}</td>
|
||||
<td><button class="btn btn-warning btn-sm"><i class="fas fa-search"></i> Review</button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
@else
|
||||
<div class="alert alert-warning">
|
||||
|
||||
<i class="fas fa-exclamation-triangle"></i><span> {{__('No requests')}}</span>
|
||||
<p>
|
||||
{{__('There are no registered requests, of any status (declined, approved, pending).')}}
|
||||
</p>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<a href="{{ route('absences.create') }}"><button class="btn btn-success btn-sm"><i class="fas fa-plus-circle"></i> New request</button></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@stop
|
Reference in New Issue
Block a user