75 lines
3.3 KiB
Plaintext
75 lines
3.3 KiB
Plaintext
@inject IConfiguration Configuration
|
|
@{
|
|
var hideZero = bool.Parse(Configuration[nameof(UserConfig.HideZero)]);
|
|
}
|
|
@model VehicleHistoryViewModel
|
|
<div class="vehicleDetailTabContainer">
|
|
<div class="row mt-2">
|
|
<div class="d-flex">
|
|
<img src="/defaults/lubelogger_logo.png" />
|
|
<span class="display-6 ms-5">Vehicle Maintenance Report</span>
|
|
</div>
|
|
</div>
|
|
<hr />
|
|
<div class="row">
|
|
<div class="col-6">
|
|
<ul class="list-group">
|
|
<li class="list-group-item">
|
|
<span class="display-6">@($"{Model.VehicleData.Year} {Model.VehicleData.Make} {Model.VehicleData.Model}")</span>
|
|
</li>
|
|
<li class="list-group-item">
|
|
<span class="lead">@Model.VehicleData.LicensePlate</span>
|
|
</li>
|
|
<li class="list-group-item">
|
|
@if (Model.VehicleData.IsElectric)
|
|
{
|
|
<span><i class="bi bi-ev-station"></i> Electric</span>
|
|
}
|
|
else
|
|
{
|
|
<span><i class="bi bi-fuel-pump"></i> Gasoline</span>
|
|
}
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-6">
|
|
<ul class="list-group">
|
|
<li class="list-group-item">Last Reported Odometer Reading: @Model.Odometer</li>
|
|
<li class="list-group-item">Average Fuel Economy: @Model.MPG.ToString("F")</li>
|
|
<li class="list-group-item">Total Spent(excl. fuel): @Model.TotalCost.ToString("C")</li>
|
|
<li class="list-group-item">Total Spent on Fuel: @Model.TotalGasCost.ToString("C")</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<hr />
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<table class="table table-hover">
|
|
<thead>
|
|
<tr class="d-flex">
|
|
<th scope="col" class="col-1">Type</th>
|
|
<th scope="col" class="col-1">Date</th>
|
|
<th scope="col" class="col-2">Odometer</th>
|
|
<th scope="col" class="col-3">Description</th>
|
|
<th scope="col" class="col-2">Cost</th>
|
|
<th scope="col" class="col-3">Notes</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach (GenericReportModel reportData in Model.VehicleHistory)
|
|
{
|
|
<tr class="d-flex" style="cursor:pointer;">
|
|
<td class="col-1">@reportData.DataType.ToString()</td>
|
|
<td class="col-1">@reportData.Date.ToShortDateString()</td>
|
|
<td class="col-2">@(reportData.Odometer == default ? "---" : reportData.Odometer.ToString("N0"))</td>
|
|
<td class="col-3">@reportData.Description</td>
|
|
<td class="col-2">@((hideZero && reportData.Cost == default) ? "---" : reportData.Cost.ToString("C"))</td>
|
|
<td class="col-3 text-wrap">@CarCareTracker.Helper.StaticHelper.TruncateStrings(reportData.Notes, 100)</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|