Compare commits

..

5 Commits

Author SHA1 Message Date
DESKTOP-GENO133\IvanPlex
25e32589d4 disabled CSV imports by default. 2024-01-05 11:51:03 -07:00
DESKTOP-GENO133\IvanPlex
1727f0d193 placeholder for tax record modal 2024-01-05 11:50:15 -07:00
DESKTOP-GENO133\IvanPlex
0faffc2167 usability enhancements added placeholder text. 2024-01-05 11:22:44 -07:00
DESKTOP-GENO133\IvanPlex
999649a095 Usability enhancements: placeholders in vehicle and service record modals 2024-01-05 09:07:28 -07:00
DESKTOP-GENO133\IvanPlex
cfb8e6ea55 Usability enhancements: allow login on enter key, added icons on login and logout buttons, added placeholder on gas modal 2024-01-05 08:52:48 -07:00
9 changed files with 59 additions and 43 deletions

View File

@@ -26,7 +26,7 @@
@if (enableAuth)
{
<li class="nav-item">
<button class="nav-link" onclick="performLogOut()">Logout</button>
<button class="nav-link" onclick="performLogOut()"><i class="bi bi-box-arrow-right me-2"></i>Logout</button>
</li>
}
</ul>

View File

@@ -14,14 +14,14 @@
</div>
<div class="form-group">
<label for="inputUserPassword">Password</label>
<input type="password" id="inputUserPassword" class="form-control">
<input type="password" id="inputUserPassword" onkeyup="handlePasswordKeyPress(event)" class="form-control">
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" role="switch" id="inputPersistent">
<label class="form-check-label" for="inputPersistent">Remember Me</label>
</div>
<div class="d-grid">
<button type="button" class="btn btn-warning mt-2" onclick="performLogin()">Login</button>
<button type="button" class="btn btn-warning mt-2" onclick="performLogin()"><i class="bi bi-box-arrow-in-right me-2"></i>Login</button>
</div>
</div>
</div>

View File

@@ -1,6 +1,9 @@
@model CollisionRecordInput
@{
var isNew = Model.Id == 0;
}
<div class="modal-header">
<h5 class="modal-title">@(Model.Id == 0 ? "Add New Repair Record" : "Edit Repair Record")</h5>
<h5 class="modal-title">@(isNew ? "Add New Repair Record" : "Edit Repair Record")</h5>
<button type="button" class="btn-close" onclick="hideAddCollisionRecordModal()" aria-label="Close"></button>
</div>
<div class="modal-body">
@@ -11,15 +14,15 @@
<input type="text" id="workAroundInput" style="height:0px; width:0px; display:none;">
<label for="collisionRecordDate">Date</label>
<div class="input-group">
<input type="text" id="collisionRecordDate" class="form-control" value="@Model.Date">
<input type="text" id="collisionRecordDate" class="form-control" placeholder="Date repair was performed" value="@Model.Date">
<span class="input-group-text"><i class="bi bi-calendar-event"></i></span>
</div>
<label for="collisionRecordMileage">Odometer</label>
<input type="number" id="collisionRecordMileage" class="form-control" value="@Model.Mileage">
<input type="number" id="collisionRecordMileage" class="form-control" placeholder="Odometer reading when repaired" value="@(isNew ? "" : Model.Mileage)">
<label for="collisionRecordDescription">Description</label>
<input type="text" id="collisionRecordDescription" class="form-control" value="@Model.Description">
<input type="text" id="collisionRecordDescription" class="form-control" placeholder="Description of item(s) repaired(i.e. Alternator)" value="@Model.Description">
<label for="collisionRecordCost">Cost</label>
<input type="number" id="collisionRecordCost" class="form-control" value="@Model.Cost">
<input type="number" id="collisionRecordCost" class="form-control" placeholder="Cost of the repair" value="@(isNew ? "" : Model.Cost)">
</div>
<div class="col-md-6 col-12">
<label for="collisionRecordNotes">Notes(optional)</label>
@@ -50,16 +53,16 @@
</form>
</div>
<div class="modal-footer">
@if (Model.Id > 0)
@if (!isNew)
{
<button type="button" class="btn btn-danger" onclick="deleteCollisionRecord(@Model.Id)" style="margin-right:auto;">Delete</button>
}
<button type="button" class="btn btn-secondary" onclick="hideAddCollisionRecordModal()">Cancel</button>
@if (Model.Id == 0)
@if (isNew)
{
<button type="button" class="btn btn-primary" onclick="saveCollisionRecordToVehicle()">Add New Repair Record</button>
}
else if (Model.Id > 0)
else if (!isNew)
{
<button type="button" class="btn btn-primary" onclick="saveCollisionRecordToVehicle(true)">Edit Repair Record</button>
}

View File

@@ -1,10 +1,11 @@
@inject IConfiguration Configuration
@model GasRecordInput
@{
var useMPG = bool.Parse(Configuration[nameof(UserConfig.UseMPG)]);
var isNew = Model.Id == 0;
}
@model GasRecordInput
<div class="modal-header">
<h5 class="modal-title">@(Model.Id == 0 ? "Add New Gas Record" : "Edit Gas Record")</h5>
<h5 class="modal-title">@(isNew ? "Add New Gas Record" : "Edit Gas Record")</h5>
<button type="button" class="btn-close" onclick="hideAddGasRecordModal()" aria-label="Close"></button>
</div>
<div class="modal-body">
@@ -15,15 +16,15 @@
<input type="text" id="workAroundInput" style="height:0px; width:0px; display:none;">
<label for="gasRecordDate">Date</label>
<div class="input-group">
<input type="text" id="gasRecordDate" class="form-control" value="@Model.Date">
<input type="text" id="gasRecordDate" placeholder="Date refueled" class="form-control" value="@Model.Date">
<span class="input-group-text"><i class="bi bi-calendar-event"></i></span>
</div>
<label for="gasRecordMileage">Odometer Reading(@(useMPG ? "miles" : "kilometers"))</label>
<input type="number" id="gasRecordMileage" class="form-control" value="@Model.Mileage">
<input type="number" id="gasRecordMileage" class="form-control" placeholder="Odometer reading when refueled" value="@(isNew ? "" : Model.Mileage)">
<label for="gasRecordGallons">Fuel Consumption(@(useMPG ? "gallons" : "liters"))</label>
<input type="text" id="gasRecordGallons" class="form-control" value="@Model.Gallons">
<input type="text" id="gasRecordGallons" class="form-control" placeholder="Amount of gas it takes to fill back up to full" value="@(isNew ? "" : Model.Gallons)">
<label for="GasRecordCost">Cost</label>
<input type="number" id="gasRecordCost" class="form-control" value="@Model.Cost">
<input type="number" id="gasRecordCost" class="form-control" placeholder="Cost of gas it takes to fill back up to full" value="@(isNew ? "" : Model.Cost)">
</div>
<div class="col-md-6 col-12">
@if (Model.Files.Any())
@@ -52,16 +53,16 @@
</form>
</div>
<div class="modal-footer">
@if (Model.Id > 0)
@if (!isNew)
{
<button type="button" class="btn btn-danger" onclick="deleteGasRecord(@Model.Id)" style="margin-right:auto;">Delete</button>
}
<button type="button" class="btn btn-secondary" onclick="hideAddGasRecordModal()">Cancel</button>
@if (Model.Id == 0)
@if (isNew)
{
<button type="button" class="btn btn-primary" onclick="saveGasRecordToVehicle()">Add New Gas Record</button>
}
else if (Model.Id > 0)
else if (!isNew)
{
<button type="button" class="btn btn-primary" onclick="saveGasRecordToVehicle(true)">Edit Gas Record</button>
}

View File

@@ -1,6 +1,9 @@
@model ServiceRecordInput
@{
var isNew = Model.Id == 0;
}
<div class="modal-header">
<h5 class="modal-title">@(Model.Id == 0 ? "Add New Service Record" : "Edit Service Record")</h5>
<h5 class="modal-title">@(isNew ? "Add New Service Record" : "Edit Service Record")</h5>
<button type="button" class="btn-close" onclick="hideAddServiceRecordModal()" aria-label="Close"></button>
</div>
<div class="modal-body">
@@ -11,15 +14,15 @@
<input type="text" id="workAroundInput" style="height:0px; width:0px; display:none;">
<label for="serviceRecordDate">Date</label>
<div class="input-group">
<input type="text" id="serviceRecordDate" class="form-control" value="@Model.Date">
<input type="text" id="serviceRecordDate" class="form-control" placeholder="Date service was performed" value="@Model.Date">
<span class="input-group-text"><i class="bi bi-calendar-event"></i></span>
</div>
<label for="serviceRecordMileage">Odometer</label>
<input type="number" id="serviceRecordMileage" class="form-control" value="@Model.Mileage">
<input type="number" id="serviceRecordMileage" class="form-control" placeholder="Odometer reading when serviced" value="@(isNew ? "" : Model.Mileage)">
<label for="serviceRecordDescription">Description</label>
<input type="text" id="serviceRecordDescription" class="form-control" value="@Model.Description">
<input type="text" id="serviceRecordDescription" class="form-control" placeholder="Description of item(s) serviced(i.e. Oil Change)" value="@Model.Description">
<label for="serviceRecordCost">Cost</label>
<input type="number" id="serviceRecordCost" class="form-control" value="@Model.Cost">
<input type="number" id="serviceRecordCost" class="form-control" placeholder="Cost of the service" value="@(isNew ? "" : Model.Cost)">
</div>
<div class="col-md-6 col-12">
<label for="serviceRecordNotes">Notes(optional)</label>
@@ -50,16 +53,16 @@
</form>
</div>
<div class="modal-footer">
@if (Model.Id > 0)
@if (!isNew)
{
<button type="button" class="btn btn-danger" onclick="deleteServiceRecord(@Model.Id)" style="margin-right:auto;">Delete</button>
}
<button type="button" class="btn btn-secondary" onclick="hideAddServiceRecordModal()">Cancel</button>
@if (Model.Id == 0)
@if (isNew)
{
<button type="button" class="btn btn-primary" onclick="saveServiceRecordToVehicle()">Add New Service Record</button>
}
else if (Model.Id > 0)
else if (!isNew)
{
<button type="button" class="btn btn-primary" onclick="saveServiceRecordToVehicle(true)">Edit Service Record</button>
}

View File

@@ -1,6 +1,9 @@
@model TaxRecordInput
@{
var isNew = Model.Id == 0;
}
<div class="modal-header">
<h5 class="modal-title">@(Model.Id == 0 ? "Add New Tax Record" : "Edit Tax Record")</h5>
<h5 class="modal-title">@(isNew ? "Add New Tax Record" : "Edit Tax Record")</h5>
<button type="button" class="btn-close" onclick="hideAddTaxRecordModal()" aria-label="Close"></button>
</div>
<div class="modal-body">
@@ -11,13 +14,13 @@
<input type="text" id="workAroundInput" style="height:0px; width:0px; display:none;">
<label for="taxRecordDate">Date</label>
<div class="input-group">
<input type="text" id="taxRecordDate" class="form-control" value="@Model.Date">
<input type="text" id="taxRecordDate" class="form-control" placeholder="Date tax was paid" value="@Model.Date">
<span class="input-group-text"><i class="bi bi-calendar-event"></i></span>
</div>
<label for="taxRecordDescription">Description</label>
<input type="text" id="taxRecordDescription" class="form-control" value="@Model.Description">
<input type="text" id="taxRecordDescription" class="form-control" placeholder="Description of tax paid(i.e. Registration)" value="@Model.Description">
<label for="taxRecordCost">Cost</label>
<input type="number" id="taxRecordCost" class="form-control" value="@Model.Cost">
<input type="number" id="taxRecordCost" class="form-control" placeholder="Cost of tax paid" value="@(isNew? "" : Model.Cost)">
</div>
<div class="col-md-6 col-12">
<label for="taxRecordNotes">Notes(optional)</label>
@@ -48,16 +51,16 @@
</form>
</div>
<div class="modal-footer">
@if (Model.Id > 0)
@if (!isNew)
{
<button type="button" class="btn btn-danger" onclick="deleteTaxRecord(@Model.Id)" style="margin-right:auto;">Delete</button>
}
<button type="button" class="btn btn-secondary" onclick="hideAddTaxRecordModal()">Cancel</button>
@if (Model.Id == 0)
@if (isNew)
{
<button type="button" class="btn btn-primary" onclick="saveTaxRecordToVehicle()">Add New Tax Record</button>
}
else if (Model.Id > 0)
else if (!isNew)
{
<button type="button" class="btn btn-primary" onclick="saveTaxRecordToVehicle(true)">Edit Tax Record</button>
}

View File

@@ -1,24 +1,25 @@
@model Vehicle
@{
var isNew = Model.Id == 0;
if (Model.ImageLocation == "/defaults/noimage.png")
{
Model.ImageLocation = "";
}
}
<div class="modal-header">
<h5 class="modal-title" id="addVehicleModalLabel">@(Model.Id == 0 ? "Add New Vehicle" : "Edit Vehicle")</h5>
<h5 class="modal-title" id="addVehicleModalLabel">@(isNew ? "Add New Vehicle" : "Edit Vehicle")</h5>
</div>
<div class="modal-body">
<form class="form-inline">
<div class="form-group">
<label for="inputYear">Year</label>
<input type="number" id="inputYear" class="form-control" value="@(Model.Year > 0 ? Model.Year : "")">
<input type="number" id="inputYear" class="form-control" placeholder="Year(must be after 1900)" value="@(isNew ? "" : Model.Year)">
<label for="inputMake">Make</label>
<input type="text" id="inputMake" class="form-control" value="@Model.Make">
<input type="text" id="inputMake" class="form-control" placeholder="Make" value="@Model.Make">
<label for="inputModel">Model</label>
<input type="text" id="inputModel" class="form-control" value="@Model.Model">
<input type="text" id="inputModel" class="form-control" placeholder="Model" value="@Model.Model">
<label for="inputLicensePlate">License Plate</label>
<input type="text" id="inputLicensePlate" class="form-control" value="@Model.LicensePlate">
<input type="text" id="inputLicensePlate" class="form-control" placeholder="License Plate" value="@Model.LicensePlate">
@if (!string.IsNullOrWhiteSpace(Model.ImageLocation))
{
<label for="inputImage">Replace picture(optional)</label>
@@ -32,11 +33,11 @@
</form>
</div>
<div class="modal-footer">
@if (Model.Id == 0)
@if (isNew)
{
<button type="button" class="btn btn-secondary" onclick="hideAddVehicleModal()">Cancel</button>
<button type="button" onclick="saveVehicle(false)" class="btn btn-primary">Add New Vehicle</button>
} else if (Model.Id > 0)
} else if (!isNew)
{
<button type="button" class="btn btn-secondary" onclick="hideEditVehicleModal()">Cancel</button>
<button type="button" onclick="saveVehicle(true)" class="btn btn-primary">Save Vehicle</button>

View File

@@ -1 +1 @@
{"UseDarkMode":true,"EnableCsvImports":true,"UseMPG":true,"UseDescending":false,"EnableAuth":false,"UserNameHash":"","UserPasswordHash":""}
{"UseDarkMode":true,"EnableCsvImports":false,"UseMPG":true,"UseDescending":false,"EnableAuth":false,"UserNameHash":"","UserPasswordHash":""}

View File

@@ -10,3 +10,8 @@
}
})
}
function handlePasswordKeyPress(event) {
if (event.keyCode == 13) {
performLogin();
}
}