Change supplier resources to use components

This commit is contained in:
2024-08-18 13:58:18 +10:00
parent 283ae06a5c
commit 5139b26a05
12 changed files with 255 additions and 558 deletions

View File

@@ -1,8 +1,10 @@
<!-- $o = Supplier::class -->
<!-- $spo=Supplier::class -->
@use(App\Models\Supplier)
<div class="row">
<div class="col-5 col-sm-2">
<div class="nav flex-column nav-tabs h-100" role="tablist" aria-orientation="vertical">
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
@foreach(Supplier::offeringTypes($spo) as $key => $offering)
<a class="nav-link @if($loop->first)active @endif" id="offering-{{ $key }}-tab" data-toggle="pill" href="#offering-{{ $key }}-profile" role="tab" aria-controls="offering-{{ $key }}-tab" aria-selected="true">{{ $offering->type }}</a>
@endforeach
</div>
@@ -10,7 +12,7 @@
<div class="col-7 col-sm-10">
<div class="tab-content">
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
@foreach(Supplier::offeringTypes($spo) as $key => $offering)
<div class="tab-pane text-left fade show @if($loop->first)active @endif" id="offering-{{ $key }}-profile" role="tabpanel" aria-labelledby="offering-{{ $key }}-tab">
<table class="table table-sm table-bordered w-100" id="offering-{{ $key }}-table">
<thead>
@@ -66,13 +68,12 @@
</div>
</div>
@section('page-scripts')
@css(datatables,bootstrap4)
@js(datatables,bootstrap4)
@pa(datatables)
@section('page-scripts')
<script type="text/javascript">
$(document).ready(function() {
@foreach(\App\Models\Supplier::offeringTypes($o) as $key => $offering)
@foreach(Supplier::offeringTypes($spo) as $key => $offering)
$('#offering-{{ $key }}-table').DataTable();
$('#offering-{{ $key }}-table tbody').on('click','tr', function () {