2022-11-04 06:20:22 +00:00
<!-- $o = Filearea :: class -->
2024-10-23 11:21:42 +00:00
@ use ( App\Models\Domain )
2024-10-24 00:31:20 +00:00
@ use ( App\Classes\FTN\Message )
2024-12-06 03:44:19 +00:00
2021-08-11 13:45:30 +00:00
@ extends ( 'layouts.app' )
@ section ( 'htmlheader_title' )
@ if ( $o -> exists ) Update @ else Add @ endif Filearea
@ endsection
@ section ( 'content' )
2024-12-06 00:16:38 +00:00
< form class = " needs-validation " method = " post " autocomplete = " off " novalidate >
2021-08-11 13:45:30 +00:00
@ csrf
< div class = " row " >
< div class = " col-12 " >
< div class = " greyframe titledbox shadow0xb0 " >
< h2 class = " cap " >@ if ( $o -> exists ) Update @ else Add @ endif Filearea </ h2 >
< div class = " row " >
< div class = " col-3 " >
2024-12-06 03:44:19 +00:00
@ php
$helper = ( ! $o -> domain_id )
? sprintf ( 'Add a <a href="%s">NEW Domain</a>' , url ( 'domain/addedit' ))
: NULL ;
@ endphp
< x - form . select name = " domain_id " icon = " bi-tag-fill " label = " Domain " feedback = " Domain is required " : helper = " $helper " : value = " $o->domain_id " : options = " Domain::active()->orderBy('name')->cursor()->map(fn( $item )=>['id'=> $item->id ,'value'=> $item->name ]) " required />
2021-08-11 13:45:30 +00:00
</ div >
< div class = " col-4 " >
< label for = " name " class = " form-label " > Name </ label >
< div class = " input-group has-validation " >
< span class = " input-group-text " >< i class = " bi bi-tag-fill " ></ i ></ span >
< input type = " text " class = " form-control @error('name') is-invalid @enderror " id = " name " placeholder = " Name " name = " name " value = " { { old('name', $o->name ) }} " required @ cannot ( 'admin' , $o ) disabled @ endcannot autofocus >
< span class = " invalid-feedback " role = " alert " >
@ error ( 'name' )
2022-11-04 06:20:22 +00:00
{{ $message }}
2021-08-11 13:45:30 +00:00
@ else
A name is required .
2022-11-04 06:20:22 +00:00
@ enderror
2021-08-11 13:45:30 +00:00
</ span >
</ div >
</ div >
2024-10-23 11:21:42 +00:00
@ can ( 'admin' , $o )
2023-07-29 03:17:36 +00:00
< div class = " offset-1 col-2 " style = " padding-left: 20px; " >
2021-08-11 13:45:30 +00:00
< label for = " active " class = " form-label " > Active </ label >
< div class = " input-group " >
< div class = " btn-group " role = " group " >
< input type = " radio " class = " btn-check " name = " active " id = " active_yes " value = " 1 " required @ cannot ( 'admin' , $o ) disabled @ endcannot @ if ( old ( 'active' , $o -> active ? ? TRUE )) checked @ endif >
< label class = " btn btn-outline-success " for = " active_yes " > Yes </ label >
< input type = " radio " class = " btn-check btn-danger " name = " active " id = " active_no " value = " 0 " required @ cannot ( 'admin' , $o ) disabled @ endcannot @ if ( ! old ( 'active' , $o -> active ? ? TRUE )) checked @ endif >
< label class = " btn btn-outline-danger " for = " active_no " > No </ label >
</ div >
</ div >
</ div >
< div class = " col-2 " >
2023-07-28 03:22:39 +00:00
< label for = " show " class = " form-label " > Show < i class = " bi bi-info-circle " title = " Show this area in the activity reports " ></ i ></ label >
2021-08-11 13:45:30 +00:00
< div class = " input-group " >
< div class = " btn-group " role = " group " >
2023-07-28 03:22:39 +00:00
< input type = " radio " class = " btn-check " name = " show " id = " show_yes " value = " 1 " required @ cannot ( 'admin' , $o ) disabled @ endcannot @ if ( old ( 'show' , $o -> show ? ? TRUE )) checked @ endif >
< label class = " btn btn-outline-success " for = " show_yes " > Yes </ label >
2021-08-11 13:45:30 +00:00
2023-07-28 03:22:39 +00:00
< input type = " radio " class = " btn-check btn-danger " name = " show " id = " show_no " value = " 0 " required @ cannot ( 'admin' , $o ) disabled @ endcannot @ if ( ! old ( 'show' , $o -> show ? ? TRUE )) checked @ endif >
< label class = " btn btn-outline-danger " for = " show_no " > No </ label >
2021-08-11 13:45:30 +00:00
</ div >
</ div >
</ div >
2024-10-23 11:21:42 +00:00
@ endcan
2021-08-11 13:45:30 +00:00
</ div >
< div class = " row " >
2023-07-29 03:17:36 +00:00
< div class = " col-5 " >
2021-08-11 13:45:30 +00:00
< label for = " description " class = " form-label " > Description </ label >
< div class = " input-group has-validation " >
< span class = " input-group-text " >< i class = " bi bi-file-text-fill " ></ i ></ span >
< input type = " text " class = " form-control @error('description') is-invalid @enderror " id = " description " placeholder = " Description " name = " description " value = " { { old('description', $o->description ) }} " @ cannot ( 'admin' , $o ) disabled @ endcannot >
< span class = " invalid-feedback " role = " alert " >
@ error ( 'description' )
2022-11-04 06:20:22 +00:00
{{ $message }}
2021-08-11 13:45:30 +00:00
@ enderror
</ span >
</ div >
</ div >
2024-10-23 11:21:42 +00:00
@ can ( 'admin' , $o )
2023-07-29 03:17:36 +00:00
< div class = " col-3 " >
2022-11-04 06:20:22 +00:00
< label for = " nodelist " class = " form-label " > Nodelist File Name </ label >
< div class = " input-group has-validation " >
< span class = " input-group-text " >< i class = " bi bi-file-earmark-break-fill " ></ i ></ span >
2023-12-14 11:48:27 +00:00
< input type = " text " class = " form-control @error('nodelist') is-invalid @enderror " id = " nodelist " placeholder = " NODELIST.Z?? " name = " nodelist " value = " { { old('nodelist', $o->domain ?->nodelist) }} " @ cannot ( 'admin' , $o -> domain ) disabled @ endcannot >
2022-11-04 06:20:22 +00:00
< span class = " invalid-feedback " role = " alert " >
@ error ( 'nodelist' )
{{ $message }}
@ enderror
</ span >
</ div >
</ div >
2023-07-29 03:17:36 +00:00
< div class = " col-2 " >
< label for = " sec_read " class = " form-label " > Read < i class = " bi bi-info-circle " title = " Min security level required for read access " ></ i ></ label >
< div class = " input-group has-validation " >
< span class = " input-group-text " >< i class = " bi bi-eyeglasses " ></ i ></ span >
< input type = " text " class = " form-control text-end @error('sec_read') is-invalid @enderror " id = " sec_read " placeholder = " # " name = " sec_read " value = " { { old('sec_read', $o->sec_read ) }} " required @ cannot ( 'admin' , $o ) disabled @ endcannot autofocus >
< span class = " invalid-feedback " role = " alert " >
@ error ( 'sec_read' )
{{ $message }}
@ enderror
</ span >
</ div >
</ div >
< div class = " col-2 " >
< label for = " sec_write " class = " form-label " > Write < i class = " bi bi-info-circle " title = " Min security level required for write access " ></ i ></ label >
< div class = " input-group has-validation " >
< span class = " input-group-text " >< i class = " bi bi-pencil " ></ i ></ span >
< input type = " text " class = " form-control text-end @error('sec_write') is-invalid @enderror " id = " sec_write " placeholder = " # " name = " sec_write " value = " { { old('sec_write', $o->sec_write ) }} " required @ cannot ( 'admin' , $o ) disabled @ endcannot autofocus >
< span class = " invalid-feedback " role = " alert " >
@ error ( 'sec_write' )
{{ $message }}
@ enderror
</ span >
</ div >
</ div >
2024-10-23 11:21:42 +00:00
@ endcan
2021-08-11 13:45:30 +00:00
</ div >
2024-10-23 11:21:42 +00:00
@ can ( 'admin' , $o )
2024-12-06 10:30:44 +00:00
< div class = " row " >
< div class = " col-12 " >
< x - form . notes name = " notes " label = " Notes " rows = 3 placeholder = " Notes... " : value = " $o->notes " />
</ div >
2021-08-11 13:45:30 +00:00
</ div >
2024-12-06 10:30:44 +00:00
< div class = " row " >
< div class = " col-12 " >
< a href = " { { url('filearea') }} " class = " btn btn-danger " > Cancel </ a >
< button type = " submit " name = " submit " class = " btn btn-success float-end " >@ if ( $o -> exists ) Save @ else Add @ endif </ button >
</ div >
2021-08-11 13:45:30 +00:00
</ div >
2024-10-23 11:21:42 +00:00
@ endcan
2021-08-11 13:45:30 +00:00
</ div >
</ div >
</ div >
2024-10-23 11:08:57 +00:00
2024-12-06 03:44:19 +00:00
<!-- @ todo Show exported systems and files waiting -->
2024-10-23 11:08:57 +00:00
< div class = " row " >
< div class = " col-12 " >
@ if ( $o -> files -> count ())
< table class = " table monotable " id = " files " >
< thead >
< tr >
< th > ID </ th >
< th > File </ th >
< th > Size </ th >
< th > Hatched </ th >
< th > Description </ th >
</ tr >
</ thead >
< tbody >
@ foreach ( $o -> files as $oo )
< tr >
< td >< a href = " { { url('file/view',[ $oo->id ]) }} " > {{ $oo -> id }} </ a ></ td >
< td > {{ $oo -> name }} </ td >
< td class = " text-end " > {{ number_format ( $oo -> size ) }} </ td >
< td > {{ $oo -> datetime -> format ( 'Y-m-d H:i:s' ) }} </ td >
2024-10-24 04:37:41 +00:00
< td >< small > { !! Message :: tr ( $oo -> desc ? : '' ) !! } </ small ></ td >
2024-10-23 11:08:57 +00:00
</ tr >
@ endforeach
</ tbody >
</ table >
@ else
< p > No files yet in this area .</ p >
@ endif
</ div >
</ div >
2021-08-11 13:45:30 +00:00
</ form >
2024-10-23 11:08:57 +00:00
@ endsection
2024-12-06 03:44:19 +00:00
@ pa ( datatables , conditionalpaging )
2024-10-23 11:08:57 +00:00
@ section ( 'page-scripts' )
< script type = " text/javascript " >
$ ( document ) . ready ( function () {
$ ( '#files' ) . DataTable ({
paging : true ,
pageLength : 25 ,
searching : true ,
ordering : true ,
order : [ 1 , 'asc' ],
conditionalPaging : {
style : 'fade' ,
speed : 500 // optional
},
});
});
</ script >
@ append