Allow users to select any extra field as vehicle identifier.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
}
|
||||
@model Vehicle
|
||||
@{
|
||||
ViewData["Title"] = $"{Model.Year} {Model.Make} {Model.Model} ({Model.LicensePlate})";
|
||||
ViewData["Title"] = $"{Model.Year} {Model.Make} {Model.Model} ({StaticHelper.GetVehicleIdentifier(Model)})";
|
||||
}
|
||||
@section Scripts {
|
||||
<script src="~/js/vehicle.js?v=@StaticHelper.VersionNumber"></script>
|
||||
@@ -72,7 +72,7 @@
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<button onclick="returnToGarage()" class="lubelogger-tab btn btn-secondary btn-md mt-1 mb-1"><i class="bi bi-arrow-left-square"></i></button>
|
||||
<h1 class="text-truncate display-4">@($"{Model.Year} {Model.Make} {Model.Model}")<small class="text-body-secondary">@($"(#{Model.LicensePlate})")</small></h1>
|
||||
<h1 class="text-truncate display-4">@($"{Model.Year} {Model.Make} {Model.Model}")<small class="text-body-secondary">@($"(#{StaticHelper.GetVehicleIdentifier(Model)})")</small></h1>
|
||||
<button onclick="editVehicle(@Model.Id)" class="lubelogger-tab btn btn-warning btn-md mt-1 mb-1"><i class="bi bi-pencil-square"></i></button>
|
||||
<div class="lubelogger-navbar-button">
|
||||
<button type="button" class="btn btn-adaptive" onclick="showMobileNav()"><i class="bi bi-list lubelogger-menu-icon"></i></button>
|
||||
|
||||
@@ -21,9 +21,21 @@
|
||||
<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>
|
||||
@if (!string.IsNullOrWhiteSpace(Model.VehicleData.LicensePlate))
|
||||
{
|
||||
<li class="list-group-item">
|
||||
<span class="lead">@Model.VehicleData.LicensePlate</span>
|
||||
</li>
|
||||
}
|
||||
@foreach(ExtraField extraField in Model.VehicleData.ExtraFields)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(extraField.Value))
|
||||
{
|
||||
<li class="list-group-item">
|
||||
<span class="lead">@($"{extraField.Name}: {extraField.Value}")</span>
|
||||
</li>
|
||||
}
|
||||
}
|
||||
<li class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
|
||||
@@ -44,10 +44,18 @@
|
||||
<input type="text" id="@elementId" class="form-control @(field.IsRequired ? "extra-field-required" : "")" placeholder="@field.Name" value="@field.Value">
|
||||
</div>
|
||||
}
|
||||
<label for="inputIdentifier">@translator.Translate(userLanguage, "Identifier")</label>
|
||||
<select class="form-select" id="inputIdentifier" )>
|
||||
<!option value="LicensePlate" @(Model.VehicleIdentifier == "LicensePlate" ? "selected" : "")>@translator.Translate(userLanguage, "License Plate")</!option>
|
||||
@foreach(ExtraField field in Model.ExtraFields)
|
||||
{
|
||||
<!option value="@field.Name" @(Model.VehicleIdentifier == field.Name ? "selected" : "")>@field.Name</!option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<label for="inputFuelType">@translator.Translate(userLanguage, "Fuel Type")</label>
|
||||
<select class="form-select" onchange="checkCustomMonthInterval()" id="inputFuelType")>
|
||||
<select class="form-select" id="inputFuelType")>
|
||||
<!option value="Gasoline" @(!Model.IsDiesel && !Model.IsElectric ? "selected" : "")>@translator.Translate(userLanguage, "Gasoline")</!option>
|
||||
<!option value="Diesel" @(Model.IsDiesel ? "selected" : "")>@translator.Translate(userLanguage, "Diesel")</!option>
|
||||
<!option value="Electric" @(Model.IsElectric ? "selected" : "")>@translator.Translate(userLanguage, "Electric")</!option>
|
||||
|
||||
Reference in New Issue
Block a user