minor fixes

This commit is contained in:
Jagad R R
2025-01-02 18:21:03 +07:00
parent 8255a530af
commit 0c052f379a
8 changed files with 935 additions and 913 deletions
@@ -35,45 +35,47 @@
<div class="clearfix"></div>
<div class="dataTables_wrapper dt-bootstrap4 mt-2">
@include('backend.layouts.partials.messages')
<table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%">
<thead class="bg-light text-capitalize">
<tr>
<th>#</th>
<th>Code</th>
<th>Nama</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach ($costs as $cost)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $cost->code }}</td>
<td>{{ $cost->name }}</td>
<td>
@if (auth()->user()->can('admin.edit'))
<a class="btn btn-success btn-sm text-white" href="{{ route('admin.cost.edit', $cost->id) }}">Edit</a>
@endif
@if (auth()->user()->can('admin.delete'))
<a class="btn btn-danger text-white btn-sm" href="javascript:void(0);"
onclick="event.preventDefault(); if(confirm('Are you sure you want to delete?')) { document.getElementById('delete-form-{{ $cost->id }}').submit(); }">
{{ __('Delete') }}
</a>
<div class="table-responsive">
<table id="dataTable"
class="table table-bordered table-striped table-head-fixed dataTable dtr-inline"
style="width:100%">
<thead class="bg-light text-capitalize">
<tr>
<th>#</th>
<th>Code</th>
<th>Nama</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>
@foreach ($costs as $cost)
<tr>
<td>{{ $loop->index + 1 }}</td>
<td>{{ $cost->code }}</td>
<td>{{ $cost->name }}</td>
<td>
@if (auth()->user()->can('admin.edit'))
<a class="btn btn-success btn-sm text-white" href="{{ route('admin.cost.edit', $cost->id) }}">Edit</a>
@endif
@if (auth()->user()->can('admin.delete'))
<a class="btn btn-danger text-white btn-sm" href="javascript:void(0);"
onclick="event.preventDefault(); if(confirm('Are you sure you want to delete?')) { document.getElementById('delete-form-{{ $cost->id }}').submit(); }">
{{ __('Delete') }}
</a>
<form id="delete-form-{{ $cost->id }}"
action="{{ route('admin.cost.destroy', $cost->id) }}"
method="POST" style="display: none;">
@method('DELETE')
@csrf
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<form id="delete-form-{{ $cost->id }}"
action="{{ route('admin.cost.destroy', $cost->id) }}"
method="POST" style="display: none;">
@method('DELETE')
@csrf
</form>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@@ -86,7 +88,7 @@
$(document).ready(function () {
if ($('#dataTable').length) {
$('#dataTable').DataTable({
responsive: true,
responsive: false,
dom: 'Bfrtip',
buttons: [
'excel', 'pdf', 'print'