Complete implement of select2 component, and replaced existing use of select2. Also deprecated CustomBlade definitions of select2/simplemde
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 43s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m34s
Create Docker Image / Final Docker Image Manifest (push) Successful in 11s

This commit is contained in:
2024-12-06 14:44:19 +11:00
parent e3c45dfd3d
commit e9b5783945
20 changed files with 118 additions and 255 deletions

View File

@@ -1,3 +1,6 @@
<!-- $o=Address::class -->
@use(App\Models\System)
@extends('layouts.app')
@section('htmlheader_title')
@@ -22,26 +25,11 @@ Move Address
<div class="row">
<!-- Choose System -->
<div class="col-4">
<label for="system_id" class="form-label">Move <strong class="highlight">{{ $o->ftn }}</strong> to system:</label>
<div class="input-group has-validation">
<span class="input-group-text"><i class="bi bi-display-fill"></i></span>
<select style="width: 80%;" class="form-select @error('system_id') is-invalid @enderror" id="system_id" name="system_id" required @cannot('admin',$o)disabled @endcannot>
<option value="">&nbsp;</option>
@foreach (\App\Models\System::active()->where('id','<>',$o->system_id)->cursor() as $oo)
<option value="{{ $oo->id }}" @if(old('system_id')==$oo->id)selected @endif>{{ $oo->name }}</option>
@endforeach
</select>
<span class="invalid-feedback" role="alert">
@error('system_id')
{{ $message }}
@else
Please select the System that should have the address.
@enderror
</span>
<span class="input-helper">
Add a <a href="{{ url('system/addedit') }}">NEW System</a>
</span>
</div>
@php
$helper = sprintf('Add a <a href="%s">NEW System</a>',url('system/addedit'));
$label = sprintf('Move <strong class="highlight">%s</strong> to system',$o->ftn);
@endphp
<x-form.select name="system_id" icon="bi-envelope-at-fill" :label="$label" placeholder="Select System" feedback="System is required" :helper="$helper" :value="$o->system_id" :options="System::select(['id','name'])->active()->where('id','<>',$o->system_id)->cursor()->map(fn($item)=>['id'=>$item->id,'value'=>$item->name])" required/>
</div>
<div class="col-3">
@@ -109,16 +97,9 @@ Move Address
</form>
@endsection
@section('page-css')
@css('select2')
@append
@section('page-scripts')
@js('select2')
<script type="text/javascript">
$(document).ready(function() {
$('#system_id').select2();
@if ($o->is_hosted)
$('#remove_yes').on('change',function() {
if (! $('#session-remove').hasClass('d-none'))