mirror of
https://github.com/cp6/my-idlers.git
synced 2025-04-19 09:38:36 +00:00
Added datatables to server/index for sorting and searching ability.
Updated days due in to no longer give 8 digit long floats
This commit is contained in:
parent
720dc50852
commit
526f360f2c
1 changed files with 18 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
||||||
<a href="{{ route('servers-compare-choose') }}" class="btn btn-primary mb-3 ms-2">Compare
|
<a href="{{ route('servers-compare-choose') }}" class="btn btn-primary mb-3 ms-2">Compare
|
||||||
servers</a>
|
servers</a>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered" id="servers-table">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr class="bg-gray-100">
|
<tr class="bg-gray-100">
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
@ -68,7 +68,7 @@
|
||||||
<td class="text-nowrap">{{ $server->provider->name }}</td>
|
<td class="text-nowrap">{{ $server->provider->name }}</td>
|
||||||
<td class="text-nowrap">{{ $server->price->price }} {{$server->price->currency}} {{\App\Process::paymentTermIntToString($server->price->term)}}</td>
|
<td class="text-nowrap">{{ $server->price->price }} {{$server->price->currency}} {{\App\Process::paymentTermIntToString($server->price->term)}}</td>
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
{{now()->diffInDays(Carbon\Carbon::parse($server->price->next_due_date), false)}}
|
{{number_format(now()->diffInDays(Carbon\Carbon::parse($server->price->next_due_date), false), 0)}}
|
||||||
<small>days</small></td>
|
<small>days</small></td>
|
||||||
<td class="text-nowrap"> {{ $server->owned_since }}</td>
|
<td class="text-nowrap"> {{ $server->owned_since }}</td>
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
|
@ -234,5 +234,21 @@
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
window.addEventListener('load', function () {
|
||||||
|
$('#servers-table').DataTable({
|
||||||
|
"pageLength": 15,
|
||||||
|
"lengthMenu": [5, 10, 15, 25, 30, 50, 75, 100],
|
||||||
|
"columnDefs": [
|
||||||
|
{"orderable": false, "targets": [1,11]}
|
||||||
|
],
|
||||||
|
"initComplete": function () {
|
||||||
|
$('.dataTables_length,.dataTables_filter').addClass('mb-2');
|
||||||
|
$('.dataTables_paginate').addClass('mt-2');
|
||||||
|
$('.dataTables_info').addClass('mt-2 text-muted ');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@endsection
|
@endsection
|
||||||
</x-app-layout>
|
</x-app-layout>
|
||||||
|
|
Loading…
Add table
Reference in a new issue