fix: restore separate showcars form and showcarlist table views

This commit is contained in:
2026-05-01 12:30:00 -04:00
parent 18e7c9b361
commit e5dbe3e126
4 changed files with 157 additions and 52 deletions
+28 -9
View File
@@ -14,20 +14,30 @@
<div class="container-xl"> <div class="container-xl">
<div class="card"> <div class="card">
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-vcenter card-table"> <table class="table table-vcenter card-table" id="showcars-table">
<thead> <thead>
<tr> <tr>
<th>Make</th> <th class="sort" data-sort="bidder-num">Bidder #</th>
<th>Model</th> <th class="sort" data-sort="make">Make</th>
<th>Year</th> <th class="sort" data-sort="model">Model</th>
<th class="sort" data-sort="year">Year</th>
<th class="sort" data-sort="owner">Owner</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody class="list">
@foreach($showcarlist_results as $vehicle) @foreach($vehicles as $vehicle)
<tr> <tr>
<td>{{ $vehicle->make }}</td> <td class="bidder-num">{{ $vehicle->vehicleOwner->bidder_assigned_number ?? 'N/A' }}</td>
<td>{{ $vehicle->model }}</td> <td class="make">{{ $vehicle->make }}</td>
<td>{{ $vehicle->year }}</td> <td class="model">{{ $vehicle->model }}</td>
<td class="year">{{ $vehicle->year }}</td>
<td class="owner">
@if($vehicle->vehicleOwner)
{{ $vehicle->vehicleOwner->bidder_fname }} {{ $vehicle->vehicleOwner->bidder_lname }}
@else
N/A
@endif
</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
@@ -37,3 +47,12 @@
</div> </div>
</div> </div>
@endsection @endsection
@section('js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<script>
new List('showcars-table', {
valueNames: ['bidder-num', 'make', 'model', 'year', 'owner']
});
</script>
@endsection
+39
View File
@@ -0,0 +1,39 @@
@extends('tablar::page')
@section('content')
<div class="page-header d-print-none">
<div class="container-xl">
<div class="row g-2 align-items-center">
<div class="col">
<h2 class="page-title">Show Car List</h2>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="container-xl">
<div class="card">
<div class="table-responsive">
<table class="table table-vcenter card-table">
<thead>
<tr>
<th>Make</th>
<th>Model</th>
<th>Year</th>
</tr>
</thead>
<tbody>
@foreach($vehicles as $vehicle)
<tr>
<td>{{ $vehicle->make }}</td>
<td>{{ $vehicle->model }}</td>
<td>{{ $vehicle->year }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
+28 -43
View File
@@ -5,58 +5,43 @@
<div class="container-xl"> <div class="container-xl">
<div class="row g-2 align-items-center"> <div class="row g-2 align-items-center">
<div class="col"> <div class="col">
<h2 class="page-title">Show Cars</h2> <h2 class="page-title">Add Show Car</h2>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="page-body"> <div class="page-body">
<div class="container-xl"> <div class="container-xl">
<div class="row row-cards"> <div class="card">
<div class="col-12"> <div class="card-body">
<div class="card"> <form method="POST" action="/showcars" class="row g-3">
<div class="table-responsive"> {{ csrf_field() }}
<table class="table table-vcenter card-table" id="showcars-table"> <div class="col-md-4">
<thead> <label for="biddernum" class="form-label">Bidder Number</label>
<tr> <input type="text" name="biddernum" id="biddernum" class="form-control" required>
<th class="sort" data-sort="bidder-num">Bidder #</th>
<th class="sort" data-sort="make">Make</th>
<th class="sort" data-sort="model">Model</th>
<th class="sort" data-sort="year">Year</th>
<th class="sort" data-sort="owner">Owner</th>
</tr>
</thead>
<tbody class="list">
@foreach($vehicles as $vehicle)
<tr>
<td class="bidder-num">{{ $vehicle->vehicleOwner->bidder_assigned_number ?? 'N/A' }}</td>
<td class="make">{{ $vehicle->make }}</td>
<td class="model">{{ $vehicle->model }}</td>
<td class="year">{{ $vehicle->year }}</td>
<td class="owner">
@if($vehicle->vehicleOwner)
{{ $vehicle->vehicleOwner->bidder_fname }} {{ $vehicle->vehicleOwner->bidder_lname }}
@else
N/A
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div> </div>
</div> <div class="col-md-4">
<label for="vehyear" class="form-label">Year</label>
<input type="text" name="vehyear" id="vehyear" class="form-control" required>
</div>
<div class="col-md-4">
<label for="vehmake" class="form-label">Make</label>
<input type="text" name="vehmake" id="vehmake" class="form-control" required>
</div>
<div class="col-md-4">
<label for="vehmodel" class="form-label">Model</label>
<input type="text" name="vehmodel" id="vehmodel" class="form-control" required>
</div>
<div class="col-md-4">
<label for="vehtype" class="form-label">Type</label>
<input type="text" name="vehtype" id="vehtype" class="form-control" required>
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary">Add Car</button>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection
@section('js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<script>
new List('showcars-table', {
valueNames: ['bidder-num', 'make', 'model', 'year', 'owner']
});
</script>
@endsection
+62
View File
@@ -0,0 +1,62 @@
@extends('tablar::page')
@section('content')
<div class="page-header d-print-none">
<div class="container-xl">
<div class="row g-2 align-items-center">
<div class="col">
<h2 class="page-title">Show Cars</h2>
</div>
</div>
</div>
</div>
<div class="page-body">
<div class="container-xl">
<div class="row row-cards">
<div class="col-12">
<div class="card">
<div class="table-responsive">
<table class="table table-vcenter card-table" id="showcars-table">
<thead>
<tr>
<th class="sort" data-sort="bidder-num">Bidder #</th>
<th class="sort" data-sort="make">Make</th>
<th class="sort" data-sort="model">Model</th>
<th class="sort" data-sort="year">Year</th>
<th class="sort" data-sort="owner">Owner</th>
</tr>
</thead>
<tbody class="list">
@foreach($vehicles as $vehicle)
<tr>
<td class="bidder-num">{{ $vehicle->vehicleOwner->bidder_assigned_number ?? 'N/A' }}</td>
<td class="make">{{ $vehicle->make }}</td>
<td class="model">{{ $vehicle->model }}</td>
<td class="year">{{ $vehicle->year }}</td>
<td class="owner">
@if($vehicle->vehicleOwner)
{{ $vehicle->vehicleOwner->bidder_fname }} {{ $vehicle->vehicleOwner->bidder_lname }}
@else
N/A
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@section('js')
<script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
<script>
new List('showcars-table', {
valueNames: ['bidder-num', 'make', 'model', 'year', 'owner']
});
</script>
@endsection