From ef88c52658ba2bac77bca28196acd70b3db706da Mon Sep 17 00:00:00 2001 From: James Kolpack Date: Sun, 18 May 2014 19:49:04 -0400 Subject: [PATCH] Add log buttons on details pages for Vehicle and User --- Web/Controllers/LogController.cs | 2 -- Web/Views/Log/Index.cshtml | 6 ++++ Web/Views/User/Details.cshtml | 53 ++++++++++++++++---------------- Web/Views/Vehicle/Details.cshtml | 1 + 4 files changed, 34 insertions(+), 28 deletions(-) diff --git a/Web/Controllers/LogController.cs b/Web/Controllers/LogController.cs index 51272dd..458478d 100644 --- a/Web/Controllers/LogController.cs +++ b/Web/Controllers/LogController.cs @@ -45,8 +45,6 @@ namespace MileageTraker.Web.Controllers orderby log.Created descending select log).ToList(); - if (!filteredLogs.Any()) - return View("Empty"); var viewModel = new LogResultsViewModel(filteredLogs, query, CustomExtensions.YearMonthList(validLogYearMonths)); diff --git a/Web/Views/Log/Index.cshtml b/Web/Views/Log/Index.cshtml index 614c3ab..0657d58 100644 --- a/Web/Views/Log/Index.cshtml +++ b/Web/Views/Log/Index.cshtml @@ -89,3 +89,9 @@ numericLinksCount: 20 ) +@if (!Model.Logs.Any()) +{ +
+ No results. +
+} \ No newline at end of file diff --git a/Web/Views/User/Details.cshtml b/Web/Views/User/Details.cshtml index 8a37597..c1670b9 100644 --- a/Web/Views/User/Details.cshtml +++ b/Web/Views/User/Details.cshtml @@ -87,30 +87,31 @@
- @Html.ActionLink("Edit", "Edit", new { id = Model.UserId }, new { @class = "btn" }) -
- - Password - - -
- @if (Model.IsApproved) - { - @Html.ActionLink("Disable Account", "DisableUser", new {id = Model.UserId}, new {@class = "btn"}) - } - else - { - @Html.ActionLink("Enable Account", "EnableUser", new {id = Model.UserId}, new {@class = "btn"}) - } - @if (Model.IsLockedOut) - { - @Html.ActionLink("Unlock", "UnlockUser", new {id = Model.UserId}, new {@class = "btn"}) - } + @Html.ActionLink("Edit", "Edit", new { id = Model.UserId }, new { @class = "btn" }) +
+ + Password + + +
+ @if (Model.IsApproved) + { + @Html.ActionLink("Disable Account", "DisableUser", new {id = Model.UserId}, new {@class = "btn"}) + } + else + { + @Html.ActionLink("Enable Account", "EnableUser", new {id = Model.UserId}, new {@class = "btn"}) + } + @if (Model.IsLockedOut) + { + @Html.ActionLink("Unlock", "UnlockUser", new {id = Model.UserId}, new {@class = "btn"}) + } + @Html.ActionLink("Logs", "Index", "Log", new { EmployeeName = Model.FullName}, new { @class = "btn" })
diff --git a/Web/Views/Vehicle/Details.cshtml b/Web/Views/Vehicle/Details.cshtml index 9769e1b..5d7cdcb 100644 --- a/Web/Views/Vehicle/Details.cshtml +++ b/Web/Views/Vehicle/Details.cshtml @@ -20,4 +20,5 @@
@Html.ActionLink("Edit", "Edit", new { id = Model.VehicleId }, new { @class = "btn" }) + @Html.ActionLink("Logs", "Index", "Log", new { Model.VehicleId}, new { @class = "btn" })
\ No newline at end of file