2024-12-06 03:44:19 +00:00
<!-- $o = Address :: class -->
@ use ( App\Models\System )
2021-08-08 07:27:22 +00:00
@ extends ( 'layouts.app' )
@ section ( 'htmlheader_title' )
Move Address
@ endsection
@ section ( 'content' )
2024-12-06 00:16:38 +00:00
< form class = " needs-validation " method = " post " autocomplete = " off " novalidate >
2024-04-22 04:27:48 +00:00
@ csrf
2021-08-08 07:27:22 +00:00
2024-04-22 04:27:48 +00:00
< div class = " row " >
< div class = " col-12 " >
< h1 >
{{ $o -> system -> name }} - {{ $o -> ftn }} @ if ( $o -> system -> setup ) < sup class = " success " >*</ sup >@ endif
@ if ( $o -> system -> setup ) < small class = " success float-end " >* This Host </ small >@ endif
</ h1 >
2021-08-08 07:27:22 +00:00
2024-04-22 04:27:48 +00:00
<!-- @ todo The list of presented system should only be those that the user can see -->
< div class = " greyframe titledbox shadow0xb0 " >
< h2 class = " cap " > Move Address </ h2 >
2021-08-08 07:27:22 +00:00
< div class = " row " >
<!-- Choose System -->
< div class = " col-4 " >
2024-12-06 03:44:19 +00:00
@ 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 />
2021-08-08 07:27:22 +00:00
</ div >
< div class = " col-3 " >
< label for = " remove " class = " form-label " > Delete System after Move </ label >
< div class = " input-group " >
< div class = " btn-group " role = " group " >
2021-08-15 01:42:38 +00:00
< input type = " radio " class = " btn-check " name = " remove " id = " remove_yes " value = " 1 " @ if ( $o -> system -> setup || $o -> system -> addresses -> count () + $o -> system -> zcs -> count () > 1 ) disabled @ endif @ if ( old ( 'remove' , FALSE )) checked @ endif >
2021-08-08 07:27:22 +00:00
< label class = " btn btn-outline-danger " for = " remove_yes " > Yes </ label >
2021-08-15 01:42:38 +00:00
< input type = " radio " class = " btn-check " name = " remove " id = " remove_no " value = " 0 " @ if ( $o -> system -> addresses -> count () + $o -> system -> zcs -> count () > 1 ) disabled @ endif @ if ( ! old ( 'remove' , FALSE )) checked @ endif >
2021-08-08 07:27:22 +00:00
< label class = " btn btn-outline-success " for = " remove_no " > No </ label >
</ div >
</ div >
< span class = " invalid-feedback " role = " alert " >
@ error ( 'remove' )
{{ $message }}
@ enderror
</ span >
</ div >
2024-06-14 05:09:04 +00:00
@ if ( $o -> is_hosted )
2021-08-08 07:27:22 +00:00
< div class = " col-3 " id = " session-remove " >
< label for = " remsess " class = " form-label " > Remove Session Details for Zone </ label >
< div class = " input-group has-validation " >
< div class = " btn-group @error('remsess') is-invalid @enderror " role = " group " >
< input type = " radio " class = " btn-check " name = " remsess " id = " remsess_yes " value = " 1 " @ if ( $o -> system -> match ( $o -> zone ) -> count () > 1 ) disabled @ endif @ if ( old ( 'remsess' , FALSE )) checked @ endif >
< label class = " btn btn-outline-danger " for = " remsess_yes " > Yes </ label >
< input type = " radio " class = " btn-check " name = " remsess " id = " remsess_no " value = " 0 " @ if ( $o -> system -> match ( $o -> zone ) -> count () > 1 ) disabled @ endif @ if ( ! old ( 'remsess' , FALSE )) checked @ endif >
< label class = " btn btn-outline-success " for = " remsess_no " > No </ label >
</ div >
< span class = " invalid-feedback " role = " alert " >
@ error ( 'remsess' )
{{ $message }}
@ enderror
</ span >
</ div >
</ div >
@ endif
</ div >
< div class = " row " >
< div class = " col-2 " >
2023-10-05 11:42:41 +00:00
< a href = " { { url('domain') }} " class = " btn btn-danger " > Cancel </ a >
2021-08-08 07:27:22 +00:00
</ div >
< span class = " col-6 mt-auto mx-auto text-center align-bottom " >
@ if ( $errors -> count ())
< span class = " btn btn-sm btn-danger " role = " alert " >
There were errors with the submission .
@ dump ( $errors )
</ span >
@ endif
</ span >
@ can ( 'admin' , $o )
< div class = " col-2 " >
< button type = " submit " name = " submit " class = " btn btn-success float-end " > Move </ button >
</ div >
@ endcan
</ div >
2024-04-22 04:27:48 +00:00
</ div >
2021-08-08 07:27:22 +00:00
</ div >
</ div >
2024-04-22 04:27:48 +00:00
</ form >
2021-08-08 07:27:22 +00:00
@ endsection
@ section ( 'page-scripts' )
< script type = " text/javascript " >
$ ( document ) . ready ( function () {
2024-06-14 05:09:04 +00:00
@ if ( $o -> is_hosted )
2021-08-08 07:27:22 +00:00
$ ( '#remove_yes' ) . on ( 'change' , function () {
if ( ! $ ( '#session-remove' ) . hasClass ( 'd-none' ))
$ ( '#session-remove' ) . addClass ( 'd-none' );
});
$ ( '#remove_no' ) . on ( 'change' , function () {
if ( $ ( '#session-remove' ) . hasClass ( 'd-none' ))
$ ( '#session-remove' ) . removeClass ( 'd-none' );
});
@ endif
});
</ script >
@ append