moved stuff around

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-01 18:23:15 -07:00
parent 3fc2cbbb96
commit d409247abc
3 changed files with 43 additions and 42 deletions

View File

@@ -39,15 +39,7 @@
</ul>
<div class="tab-content" id="vehicleTabContent">
<div class="tab-pane fade show active" id="servicerecord-tab-pane" role="tabpanel"tabindex="0">
<div class="row">
<div class="d-flex flex-row-reverse">
<div>
<button onclick="showAddServiceRecordModal()" class="btn btn-primary btn-md mt-1 mb-1"><i class="bi bi-pencil-square"></i>Add Service Record</button>
</div>
</div>
</div>
<div class="row vehicleDetailTabContainer" id="ServiceRecordContainer">
</div>
</div>
<div class="tab-pane fade" id="gas-tab-pane" role="tabpanel" tabindex="0">111</div>
<div class="tab-pane fade" id="tax-tab-pane" role="tabpanel" tabindex="0">222</div>

View File

@@ -1,37 +1,46 @@
@model List<ServiceRecord>
<div class="col-12">
<table class="table">
<thead>
<tr class="d-flex">
<th scope="col" class="col-1">Date</th>
<th scope="col" class="col-2">Mileage</th>
<th scope="col" class="col-4">Description</th>
<th scope="col" class="col-2">Cost</th>
<th scope="col" class="col-2">Notes</th>
<th scope="col" class="col-1">Actions</th>
</tr>
</thead>
<tbody>
@foreach (ServiceRecord serviceRecord in Model)
{
<tr class="d-flex">
<td class="col-1">@serviceRecord.Date.ToShortDateString()</td>
<td class="col-2">@serviceRecord.Mileage</td>
<td class="col-4">@serviceRecord.Description</td>
<td class="col-2">@serviceRecord.Cost.ToString("C")</td>
<td class="col-2 text-truncate" onclick="showServiceRecordNotes('@serviceRecord.Notes')" style="cursor:alias;">@serviceRecord.Notes</td>
<td class="col-1">
<div class="btn-group">
<button onclick="showEditServiceRecordModal(@serviceRecord.Id)" class="btn btn-warning btn-sm"><i class="bi bi-pencil-square"></i></button>
<button onclick="deleteServiceRecord(@serviceRecord.Id)" class="btn btn-danger btn-sm"><i class="bi bi-trash"></i></button>
</div>
</td>
</tr>
}
</tbody>
</table>
<div class="row">
<div class="d-flex flex-row-reverse">
<div>
<button onclick="showAddServiceRecordModal()" class="btn btn-primary btn-md mt-1 mb-1"><i class="bi bi-pencil-square"></i>Add Service Record</button>
</div>
</div>
</div>
<div class="row vehicleDetailTabContainer">
<div class="col-12">
<table class="table">
<thead>
<tr class="d-flex">
<th scope="col" class="col-1">Date</th>
<th scope="col" class="col-2">Mileage</th>
<th scope="col" class="col-4">Description</th>
<th scope="col" class="col-2">Cost</th>
<th scope="col" class="col-2">Notes</th>
<th scope="col" class="col-1">Actions</th>
</tr>
</thead>
<tbody>
@foreach (ServiceRecord serviceRecord in Model)
{
<tr class="d-flex">
<td class="col-1">@serviceRecord.Date.ToShortDateString()</td>
<td class="col-2">@serviceRecord.Mileage</td>
<td class="col-4">@serviceRecord.Description</td>
<td class="col-2">@serviceRecord.Cost.ToString("C")</td>
<td class="col-2 text-truncate" onclick="showServiceRecordNotes('@serviceRecord.Notes')" style="cursor:alias;">@serviceRecord.Notes</td>
<td class="col-1">
<div class="btn-group">
<button onclick="showEditServiceRecordModal(@serviceRecord.Id)" class="btn btn-warning btn-sm"><i class="bi bi-pencil-square"></i></button>
<button onclick="deleteServiceRecord(@serviceRecord.Id)" class="btn btn-danger btn-sm"><i class="bi bi-trash"></i></button>
</div>
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div class="modal fade" id="addServiceRecordModal" tabindex="-1" role="dialog" aria-labelledby="addServiceRecordModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">

View File

@@ -34,7 +34,7 @@ function getVehicleNote(vehicleId) {
function getVehicleServiceRecords(vehicleId) {
$.get(`/Vehicle/GetServiceRecordsByVehicleId?vehicleId=${vehicleId}`, function (data) {
if (data) {
$("#ServiceRecordContainer").html(data);
$("#servicerecord-tab-pane").html(data);
//initiate datepicker
$('#serviceRecordDate').datepicker({
endDate: "+0d"