List files in a file area
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 32s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m46s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2024-10-23 22:08:57 +11:00
parent d20a62ad48
commit 48d329e503
2 changed files with 62 additions and 1 deletions

View File

@ -31,4 +31,9 @@ class Filearea extends Model
{
return $this->belongsTo(Domain::class);
}
public function files()
{
return $this->hasMany(File::class);
}
}

View File

@ -150,5 +150,61 @@
</div>
</div>
</div>
<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>
<td><small>{{ $oo->desc }}</small></td>
</tr>
@endforeach
</tbody>
</table>
@else
<p>No files yet in this area.</p>
@endif
</div>
</div>
</form>
@endsection
@endsection
@section('page-css')
@css('datatables')
@append
@section('page-scripts')
@js('datatables')
<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