- Convert hardcoded strings and French translation keys to English keys across Blade templates, Vue components, TypeScript modules, models, and routes - Complete and synchronize lang/fr.json and lang/en.json translation dictionaries - Add timezone attribute in lang/fr/validation.php and lang/en/validation.php - Add missing English lang files for parity: crud.php, models.php, search.php, and vue.php
97 lines
4.4 KiB
PHP
97 lines
4.4 KiB
PHP
<div class="row">
|
|
<div class="col">
|
|
<fieldset class="mb-3 border p-3">
|
|
<legend>{{ __('Exception information') }}</legend>
|
|
<div class="row mb-3">
|
|
|
|
<div class="col-12 col-md-6 form-group">
|
|
<label class="col-form-label" for="exception-date"><b>{{ Str::ucfirst(__('validation.attributes.date')) }}</b></label>
|
|
<input class="form-control" id="exception-date" name="date" type="date"
|
|
value="{{ old('date', isset($pickupException->date) ? \Carbon\Carbon::parse($pickupException->date)->format('Y-m-d') : '') }}"
|
|
aria-describedby="exception-date-help" required>
|
|
@include('bo.modules.input-error', [
|
|
'inputName' => 'date',
|
|
'helperId' => 'exception-date-help',
|
|
'helper' => __('Select the date of this exception.'),
|
|
])
|
|
</div>
|
|
|
|
<div class="col-12 col-md-6 form-group">
|
|
<label class="col-form-label"
|
|
for="exception-label"><b>{{ Str::ucfirst(__('validation.custom.attributes.label')) ?? __('Label') }}</b></label>
|
|
<div class="word-counter" data-json='@json(['for' => 'exception-label'])'></div>
|
|
<input class="form-control" id="exception-label" name="label" type="text"
|
|
value="{{ old('label', $pickupException->label ?? '') }}" aria-describedby="exception-label-help"
|
|
placeholder="{{ __('Ex: Holiday, Exceptional closure...') }}" required>
|
|
@include('bo.modules.input-error', [
|
|
'inputName' => 'label',
|
|
'helperId' => 'exception-label-help',
|
|
'helper' => __('Give this exception an explicit name.'),
|
|
])
|
|
</div>
|
|
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col">
|
|
<fieldset class="mb-3 border p-3">
|
|
<legend>{{ __('Recurrence options') }}</legend>
|
|
<div class="row align-items-center mb-3">
|
|
|
|
<div class="col-12 col-md-6 form-group pt-3">
|
|
<input class="form-check-input mt-2" id="exception-repeatable" name="repeatable" type="checkbox" value="1"
|
|
aria-describedby="exception-repeatable-help" @checked(old('repeatable', $pickupException->repeatable ?? 0))>
|
|
<label class="col-form-label form-check-label pt-1" for="exception-repeatable">
|
|
<b>{{ Str::ucfirst(__('validation.custom.attributes.repeatable')) ?? __('Repeatable exception') }}</b>
|
|
</label><br>
|
|
@include('bo.modules.input-error', [
|
|
'inputName' => 'repeatable',
|
|
'helperId' => 'exception-repeatable-help',
|
|
'helper' => __('Check if this event repeats over time.'),
|
|
])
|
|
</div>
|
|
|
|
<div class="col-12 col-md-6 form-group">
|
|
<label class="col-form-label"
|
|
for="exception-frequency"><b>{{ Str::ucfirst(__('validation.custom.attributes.repeat_frequency')) ?? __('Frequency') }}</b></label>
|
|
<select class="form-control" id="exception-frequency" name="repeat_frequency" aria-describedby="exception-frequency-help">
|
|
<option value="" @if (!old('repeat_frequency', $pickupException->repeat_frequency ?? null)) selected @endif disabled>
|
|
{{ __('Select') . ' ' . __('validation.custom.attributes.repeat_frequency') }}
|
|
</option>
|
|
@foreach (\Domain\Enums\RepeatFrequency::cases() as $frequency)
|
|
<option value="{{ $frequency->value }}" @selected(old('repeat_frequency', $pickupException->repeat_frequency ?? 'Weekly') == $frequency->value)>
|
|
{{ $frequency->label() }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
@include('bo.modules.input-error', [
|
|
'inputName' => 'repeat_frequency',
|
|
'helperId' => 'exception-frequency-help',
|
|
'helper' => __('Select the frequency if the event is repeatable (Default: Weekly).'),
|
|
])
|
|
</div>
|
|
|
|
</div>
|
|
</fieldset>
|
|
</div>
|
|
</div>
|
|
|
|
@push('scripts')
|
|
<script nonce="{{ Vite::cspNonce() }}">
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const repeatableCheckbox = document.getElementById('exception-repeatable');
|
|
const frequencySelect = document.getElementById('exception-frequency');
|
|
|
|
if (repeatableCheckbox && frequencySelect) {
|
|
const toggleFrequency = () => {
|
|
frequencySelect.disabled = !repeatableCheckbox.checked;
|
|
};
|
|
repeatableCheckbox.addEventListener('change', toggleFrequency);
|
|
toggleFrequency();
|
|
}
|
|
});
|
|
</script>
|
|
@endpush
|