mirror of
https://github.com/hargata/lubelog.git
synced 2025-12-10 00:46:08 -06:00
Merge pull request #584 from hargata/Hargata/534
Add fuel type dropdown and diesel fuel type.
This commit is contained in:
commit
4adf967f7f
@ -69,6 +69,7 @@ namespace CarCareTracker.Controllers
|
||||
LicensePlate = x.LicensePlate,
|
||||
SoldDate = x.SoldDate,
|
||||
IsElectric = x.IsElectric,
|
||||
IsDiesel = x.IsDiesel,
|
||||
UseHours = x.UseHours,
|
||||
ExtraFields = x.ExtraFields,
|
||||
Tags = x.Tags,
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
public decimal PurchasePrice { get; set; }
|
||||
public decimal SoldPrice { get; set; }
|
||||
public bool IsElectric { get; set; } = false;
|
||||
public bool IsDiesel { get; set; } = false;
|
||||
public bool UseHours { get; set; } = false;
|
||||
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
||||
public List<string> Tags { get; set; } = new List<string>();
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
public string LicensePlate { get; set; }
|
||||
public string SoldDate { get; set; }
|
||||
public bool IsElectric { get; set; } = false;
|
||||
public bool IsDiesel { get; set; } = false;
|
||||
public bool UseHours { get; set; } = false;
|
||||
public List<ExtraField> ExtraFields { get; set; } = new List<ExtraField>();
|
||||
public List<string> Tags { get; set; } = new List<string>();
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
<!option value="OneHundredThousandMiles" @(Model.ReminderMileageInterval == ReminderMileageInterval.OneHundredThousandMiles ? "selected" : "")>100000 mi. / Km</!option>
|
||||
<!option value="OneHundredFiftyThousandMiles" @(Model.ReminderMileageInterval == ReminderMileageInterval.OneHundredFiftyThousandMiles ? "selected" : "")>150000 mi. / Km</!option>
|
||||
</select>
|
||||
<label for="reminderRecurringMonth">Month</label>
|
||||
<label for="reminderRecurringMonth">@translator.Translate(userLanguage, "Month")</label>
|
||||
<select class="form-select" onchange="checkCustomMonthInterval()" id="reminderRecurringMonth" @(Model.IsRecurring && (Model.Metric == ReminderMetric.Date || Model.Metric == ReminderMetric.Both) ? "" : "disabled")>
|
||||
<!option value="Other" @(Model.ReminderMonthInterval == ReminderMonthInterval.Other ? "selected" : "")>@(Model.ReminderMonthInterval == ReminderMonthInterval.Other && Model.CustomMonthInterval > 0 ? $"{translator.Translate(userLanguage, "Other")}: {Model.CustomMonthInterval}" : $"{translator.Translate(userLanguage, "Other")}") </!option>
|
||||
<!option value="OneMonth" @(Model.ReminderMonthInterval == ReminderMonthInterval.OneMonth ? "selected" : "")>@translator.Translate(userLanguage, "1 Month")</!option>
|
||||
|
||||
@ -31,6 +31,10 @@
|
||||
{
|
||||
<span><i class="bi bi-ev-station me-2"></i>@translator.Translate(userLanguage, "Electric")</span>
|
||||
}
|
||||
else if (Model.VehicleData.IsDiesel)
|
||||
{
|
||||
<span><i class="bi bi-fuel-pump-diesel me-2"></i>@translator.Translate(userLanguage, "Diesel")</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span><i class="bi bi-fuel-pump me-2"></i>@translator.Translate(userLanguage, "Gasoline")</span>
|
||||
|
||||
@ -46,10 +46,12 @@
|
||||
}
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="inputIsElectric" checked="@Model.IsElectric">
|
||||
<label class="form-check-label" for="inputIsElectric">@translator.Translate(userLanguage, "Electric Vehicle")</label>
|
||||
</div>
|
||||
<label for="inputFuelType">@translator.Translate(userLanguage, "Fuel Type")</label>
|
||||
<select class="form-select" onchange="checkCustomMonthInterval()" 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>
|
||||
</select>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="inputUseHours" checked="@Model.UseHours">
|
||||
<label class="form-check-label" for="inputUseHours">@translator.Translate(userLanguage, "Use Engine Hours")</label>
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -40,7 +40,8 @@ function saveVehicle(isEdit) {
|
||||
var vehiclePurchaseDate = $("#inputPurchaseDate").val();
|
||||
var vehicleSoldDate = $("#inputSoldDate").val();
|
||||
var vehicleLicensePlate = $("#inputLicensePlate").val();
|
||||
var vehicleIsElectric = $("#inputIsElectric").is(":checked");
|
||||
var vehicleIsElectric = $("#inputFuelType").val() == 'Electric';
|
||||
var vehicleIsDiesel = $("#inputFuelType").val() == 'Diesel';
|
||||
var vehicleUseHours = $("#inputUseHours").is(":checked");
|
||||
var vehicleHasOdometerAdjustment = $("#inputHasOdometerAdjustment").is(':checked');
|
||||
var vehicleOdometerMultiplier = $("#inputOdometerMultiplier").val();
|
||||
@ -119,6 +120,7 @@ function saveVehicle(isEdit) {
|
||||
model: vehicleModel,
|
||||
licensePlate: vehicleLicensePlate,
|
||||
isElectric: vehicleIsElectric,
|
||||
isDiesel: vehicleIsDiesel,
|
||||
tags: vehicleTags,
|
||||
useHours: vehicleUseHours,
|
||||
extraFields: extraFields.extraFields,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user