Initial Commit.
This commit is contained in:
55
Views/Home/Index.cshtml
Normal file
55
Views/Home/Index.cshtml
Normal file
@@ -0,0 +1,55 @@
|
||||
@{
|
||||
ViewData["Title"] = "My Garage";
|
||||
}
|
||||
@model VehicleInputModel
|
||||
@section Scripts{
|
||||
<script src="~/js/site.js" asp-append-version="true"></script>
|
||||
}
|
||||
@if (Model is not null && Model.Errors.Any())
|
||||
{
|
||||
foreach(string error in Model.Errors)
|
||||
{
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
@error
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<h1>Garage</h1>
|
||||
<button onclick="showAddVehicleModal()" class="btn btn-success btn-sm mt-1 mb-1">Add Vehicle</button>
|
||||
</div>
|
||||
<div id="garageContainer" class="row gy-3">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="addVehicleModal" tabindex="-1" role="dialog" aria-labelledby="addVehicleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<form class="form-inline" asp-action="AddVehicle" enctype="multipart/form-data">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="addVehicleModalLabel">Add New Vehicle</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="inputYear">Year</label>
|
||||
<input asp-for="Year" type="number" id="inputYear" class="form-control">
|
||||
<label for="inputMake">Make</label>
|
||||
<input asp-for="Make" type="text" id="inputMake" class="form-control">
|
||||
<label for="inputModel">Model</label>
|
||||
<input asp-for="Model" type="text" id="inputModel" class="form-control">
|
||||
<label for="inputLicensePlate">License Plate</label>
|
||||
<input asp-for="LicensePlate" type="text" id="inputLicensePlate" class="form-control">
|
||||
<label for="inputImage">Upload a picture(optional)</label>
|
||||
<input asp-for="Image" type="file" accept=".png" class="form-control-file" id="inputImage">
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" onclick="hideAddVehicleModal()">Cancel</button>
|
||||
<button type="submit" class="btn btn-primary">Add New Vehicle</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
6
Views/Home/Privacy.cshtml
Normal file
6
Views/Home/Privacy.cshtml
Normal file
@@ -0,0 +1,6 @@
|
||||
@{
|
||||
ViewData["Title"] = "Privacy Policy";
|
||||
}
|
||||
<h1>@ViewData["Title"]</h1>
|
||||
|
||||
<p>Use this page to detail your site's privacy policy.</p>
|
||||
19
Views/Home/_GarageDisplay.cshtml
Normal file
19
Views/Home/_GarageDisplay.cshtml
Normal file
@@ -0,0 +1,19 @@
|
||||
@model List<Vehicle>
|
||||
|
||||
@if (Model.Any())
|
||||
{
|
||||
foreach (Vehicle vehicle in Model)
|
||||
{
|
||||
<div class="col-xl-2 col-lg-4 col-md-4 col-sm-4 col-4">
|
||||
<div class="card" onclick="viewVehicle(@vehicle.Id)">
|
||||
<img src="@vehicle.ImageLocation" style="height:145px" />
|
||||
<div class="card-body">
|
||||
<h5 class="card-title text-truncate">@($"{vehicle.Year}")</h5>
|
||||
<h5 class="card-title text-truncate">@($"{vehicle.Make}")</h5>
|
||||
<h5 class="card-title text-truncate">@($"{vehicle.Model}")</h5>
|
||||
<p class="card-text text-truncate">@vehicle.LicensePlate</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
25
Views/Shared/Error.cshtml
Normal file
25
Views/Shared/Error.cshtml
Normal file
@@ -0,0 +1,25 @@
|
||||
@model ErrorViewModel
|
||||
@{
|
||||
ViewData["Title"] = "Error";
|
||||
}
|
||||
|
||||
<h1 class="text-danger">Error.</h1>
|
||||
<h2 class="text-danger">An error occurred while processing your request.</h2>
|
||||
|
||||
@if (Model.ShowRequestId)
|
||||
{
|
||||
<p>
|
||||
<strong>Request ID:</strong> <code>@Model.RequestId</code>
|
||||
</p>
|
||||
}
|
||||
|
||||
<h3>Development Mode</h3>
|
||||
<p>
|
||||
Swapping to <strong>Development</strong> environment will display more detailed information about the error that occurred.
|
||||
</p>
|
||||
<p>
|
||||
<strong>The Development environment shouldn't be enabled for deployed applications.</strong>
|
||||
It can result in displaying sensitive information from exceptions to end users.
|
||||
For local debugging, enable the <strong>Development</strong> environment by setting the <strong>ASPNETCORE_ENVIRONMENT</strong> environment variable to <strong>Development</strong>
|
||||
and restarting the app.
|
||||
</p>
|
||||
28
Views/Shared/_Layout.cshtml
Normal file
28
Views/Shared/_Layout.cshtml
Normal file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - CarCareTracker</title>
|
||||
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css">
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
<link rel="stylesheet" href="~/CarCareTracker.styles.css" asp-append-version="true" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<main role="main" class="pb-3">
|
||||
@RenderBody()
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<footer class="border-top footer text-muted">
|
||||
<div class="container">
|
||||
© 2023 - CarCareTracker - <a asp-area="" asp-controller="Home" asp-action="Privacy">Privacy</a>
|
||||
</div>
|
||||
</footer>
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
|
||||
@await RenderSectionAsync("Scripts", required: false)
|
||||
</body>
|
||||
</html>
|
||||
48
Views/Shared/_Layout.cshtml.css
Normal file
48
Views/Shared/_Layout.cshtml.css
Normal file
@@ -0,0 +1,48 @@
|
||||
/* Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
|
||||
for details on configuring this project to bundle and minify static web assets. */
|
||||
|
||||
a.navbar-brand {
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #0077cc;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
|
||||
color: #fff;
|
||||
background-color: #1b6ec2;
|
||||
border-color: #1861ac;
|
||||
}
|
||||
|
||||
.border-top {
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
.border-bottom {
|
||||
border-bottom: 1px solid #e5e5e5;
|
||||
}
|
||||
|
||||
.box-shadow {
|
||||
box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
|
||||
}
|
||||
|
||||
button.accept-policy {
|
||||
font-size: 1rem;
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
line-height: 60px;
|
||||
}
|
||||
2
Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
2
Views/Shared/_ValidationScriptsPartial.cshtml
Normal file
@@ -0,0 +1,2 @@
|
||||
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
|
||||
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
|
||||
79
Views/Vehicle/Index.cshtml
Normal file
79
Views/Vehicle/Index.cshtml
Normal file
@@ -0,0 +1,79 @@
|
||||
@{
|
||||
ViewData["Title"] = "View Vehicle";
|
||||
}
|
||||
@model Vehicle
|
||||
@section Scripts{
|
||||
<script src="~/js/vehicle.js" asp-append-version="true"></script>
|
||||
}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<button onclick="returnToGarage()" class="btn btn-secondary btn-md mt-1 mb-1"><i class="bi bi-arrow-left-square"></i></button>
|
||||
<h1 class="text-truncate">@($"{Model.Year} {Model.Make} {Model.Model}(License # {Model.LicensePlate})")</h1>
|
||||
<div class="btn-group">
|
||||
<button onclick="showEditVehicleModal()" class="btn btn-secondary btn-md mt-1 mb-1"><i class="bi bi-pencil-square"></i></button>
|
||||
<button onclick="DeleteVehicle(@Model.Id)" class="btn btn-danger btn-md mt-1 mb-1"><i class="bi bi-trash"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<ul class="nav nav-tabs" id="vehicleTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="servicerecord-tab" data-bs-toggle="tab" data-bs-target="#servicerecord-tab-pane" type="button" role="tab" aria-selected="true">Service Records</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="notes-tab" data-bs-toggle="tab" data-bs-target="#notes-tab-pane" type="button" role="tab" aria-selected="false">Notes</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="manage-tab" data-bs-toggle="tab" data-bs-target="#manage-tab-pane" type="button" role="tab" aria-selected="false">Manage Vehicle</button>
|
||||
</li>
|
||||
</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="showEditVehicleModal()" 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">
|
||||
<div class="col-12">
|
||||
<table class="table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col">Mileage</th>
|
||||
<th scope="col">Description</th>
|
||||
<th scope="col">Cost</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="notes-tab-pane" role="tabpanel" tabindex="0">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<label for="noteTextArea" class="form-label">This is where you can store notes related to the vehicle such as tire size, oil filter size, oil types, etc.</label>
|
||||
<textarea class="form-control" id="noteTextArea" rows="15"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="d-flex flex-row-reverse">
|
||||
<div>
|
||||
<button onclick="saveVehicleNote(@Model.Id)" class="btn btn-primary btn-md mt-1 mb-1"><i class="bi bi-pencil-square"></i>Save Note</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="manage-tab-pane" role="tabpanel" tabindex="0">...</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function GetVehicleId(){
|
||||
return { vehicleId: @Model.Id};
|
||||
}
|
||||
</script>
|
||||
3
Views/_ViewImports.cshtml
Normal file
3
Views/_ViewImports.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@using CarCareTracker
|
||||
@using CarCareTracker.Models
|
||||
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
3
Views/_ViewStart.cshtml
Normal file
3
Views/_ViewStart.cshtml
Normal file
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "_Layout";
|
||||
}
|
||||
Reference in New Issue
Block a user