Add vehicle active/inactive state
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
@model MileageTraker.Web.Models.Vehicle
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Vehicle Details";
|
||||
ViewBag.Title = "Vehicle Details " + (!Model.InactiveDate.HasValue ? "(Active)" : "(Inactive)");
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
@@ -20,5 +20,13 @@
|
||||
|
||||
<div class="center-content btn-toolbar">
|
||||
@Html.ActionLink("Edit", "Edit", new { id = Model.VehicleId }, new { @class = "btn" })
|
||||
@if (!Model.InactiveDate.HasValue)
|
||||
{
|
||||
@Html.ActionLink("Set Inactive", "SetInactive", new {id = Model.VehicleId}, new {@class = "btn"})
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.ActionLink("Reactivate", "SetActive", new {id = Model.VehicleId}, new {@class = "btn"})
|
||||
}
|
||||
@Html.ActionLink("Logs", "Index", "Log", new { Model.VehicleId}, new { @class = "btn" })
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
@model IEnumerable<MileageTraker.Web.Models.Vehicle>
|
||||
@model MileageTraker.Web.ViewModels.Vehicle.VehicleResultsViewModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Vehicles";
|
||||
ViewBag.Title = "Vehicles " + (!Model.Inactive ? "(Active)" : "(Inactive)");
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
@@ -14,7 +14,8 @@
|
||||
|
||||
<div class="btn-toolbar">
|
||||
@Html.ActionLink("Add Another Vehicle", "Create", null, new{@class="btn"})
|
||||
@Html.ActionLink("Export", "Export", null, new { @class = "btn" })
|
||||
@Html.ActionLink("Export All", "Export", null, new { @class = "btn" })
|
||||
@Html.ActionLink(Model.Inactive ? "Show Active" : "Show Inactive", "Index", new {inactive = !Model.Inactive}, new { @class = "btn" })
|
||||
</div>
|
||||
<table class="table table-striped table-bordered table-hover table-condensed">
|
||||
<tr>
|
||||
@@ -51,7 +52,7 @@
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
@foreach (var item in Model.Vehicles) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.Key)
|
||||
|
||||
Reference in New Issue
Block a user