Correct reports not having all query parameters

Other small corrections
This commit is contained in:
2014-05-21 10:55:24 -04:00
parent 365aa47328
commit 750450f1f9
10 changed files with 54 additions and 43 deletions
+2 -1
View File
@@ -92,7 +92,7 @@ $(function() {
// Add active class to nav // Add active class to nav
$(function() { $(function() {
var idNavActiveRegex = { var idNavActiveRegex = {
'log-nav': /\/log/i, 'log-nav': /\/log|\/City|\/Purpose/i,
'vehicle-nav': /\/vehicle/i, 'vehicle-nav': /\/vehicle/i,
'user-nav': /\/user/i 'user-nav': /\/user/i
}; };
@@ -116,6 +116,7 @@ function addButtonIcons () {
'Delete': 'trash', 'Delete': 'trash',
'Add': 'plus', 'Add': 'plus',
'Export': 'download', 'Export': 'download',
'Import': 'upload',
'Driver Mileage': 'user', 'Driver Mileage': 'user',
'Vehicle Mileage': 'car' 'Vehicle Mileage': 'car'
}; };
+3 -1
View File
@@ -4,8 +4,10 @@
ViewBag.Title = "Cities by County"; ViewBag.Title = "Cities by County";
} }
@Html.Partial("_StatusMessage") @{ Html.RenderPartial("BackToLogs"); }
@Html.Partial("_StatusMessage")
<h2>@ViewBag.Title</h2> <h2>@ViewBag.Title</h2>
<div> <div>
+4 -3
View File
@@ -4,6 +4,7 @@
@{ @{
ViewBag.Title = "Logs"; ViewBag.Title = "Logs";
var grid = new WebGrid(Model.Logs, rowsPerPage: 45); var grid = new WebGrid(Model.Logs, rowsPerPage: 45);
var parameters = new {Model.Year, Model.Month, Model.LogType, Model.MonthRange, Model.VehicleId, Model.EmployeeName};
} }
@section Styles { @section Styles {
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" /> <link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
@@ -34,7 +35,7 @@
<div class="btn-toolbar clearfix"> <div class="btn-toolbar clearfix">
@Html.ActionLink("Add New Log", "Create", null, new { @class = "btn" }) @Html.ActionLink("Add New Log", "Create", null, new { @class = "btn" })
@Html.ActionLink("Export", "Export", new { Model.Year, Model.Month, Model.LogType, Model.MonthRange, Model.VehicleId, Model.EmployeeName }, new { @class = "btn" }) @Html.ActionLink("Export", "Export", parameters, new { @class = "btn" })
@Html.ActionLink("Purposes", "Index", "Purpose", null, new { @class = "btn" }) @Html.ActionLink("Purposes", "Index", "Purpose", null, new { @class = "btn" })
@Html.ActionLink("Cities", "Index", "City", null, new { @class = "btn" }) @Html.ActionLink("Cities", "Index", "City", null, new { @class = "btn" })
@Html.ActionLink("Import", "ImportUpload", null, new { @class = "btn"}) @Html.ActionLink("Import", "ImportUpload", null, new { @class = "btn"})
@@ -43,10 +44,10 @@
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <span class="caret"></span></a> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <span class="caret"></span></a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li> <li>
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", new { Year = Model.Year, Month = Model.Month, LogType = Model.LogType }) @Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", parameters)
</li> </li>
<li> <li>
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", new { Year = Model.Year, Month = Model.Month, LogType = Model.LogType }) @Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", parameters)
</li> </li>
</ul> </ul>
</div> </div>
+1 -17
View File
@@ -9,23 +9,7 @@
<h2>@ViewBag.Title</h2> <h2>@ViewBag.Title</h2>
<div> @Html.DisplayFor(m => m.Query)
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Year)</dt>
<dd>@Html.Encode(Model.Query.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Month)</dt>
<dd>@Html.Encode(Model.Query.Month)</dd>
</dl>
@if (Model.Query.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.Query.LogType)</dd>
</dl>
}
</div>
<table class="table"> <table class="table">
<tr> <tr>
+1 -17
View File
@@ -9,23 +9,7 @@
<h2>@ViewBag.Title</h2> <h2>@ViewBag.Title</h2>
<div> @Html.DisplayFor(m => m.Query)
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Year)</dt>
<dd>@Html.Encode(Model.Query.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Query.Month)</dt>
<dd>@Html.Encode(Model.Query.Month)</dd>
</dl>
@if (Model.Query.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.Query.LogType)</dd>
</dl>
}
</div>
<table class="table"> <table class="table">
<tr> <tr>
+2
View File
@@ -5,6 +5,8 @@
var grid = new WebGrid(Model, canSort: false, canPage: false); var grid = new WebGrid(Model, canSort: false, canPage: false);
} }
@{ Html.RenderPartial("BackToLogs"); }
@Html.Partial("_StatusMessage") @Html.Partial("_StatusMessage")
<h2>@ViewBag.Title</h2> <h2>@ViewBag.Title</h2>
@@ -0,0 +1,37 @@
@model MileageTraker.Web.ViewModels.Log.LogQueryViewModel
<div>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Year)</dt>
<dd>@Html.Encode(Model.Year)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.Month)</dt>
<dd>@Html.Encode(Model.Month)</dd>
</dl>
<dl class="inline">
<dt>@Html.DisplayNameFor(m => m.MonthRange)</dt>
<dd>@Html.Encode(Model.MonthRange)</dd>
</dl>
@if (Model.LogType.HasValue)
{
<dl class="inline">
<dt>Type</dt>
<dd>@Html.Encode(Model.LogType)</dd>
</dl>
}
@if (!string.IsNullOrEmpty(Model.VehicleId))
{
<dl class="inline">
<dt>Vehicle</dt>
<dd>@Html.Encode(Model.VehicleId)</dd>
</dl>
}
@if (!string.IsNullOrEmpty(Model.EmployeeName))
{
<dl class="inline">
<dt>Driver</dt>
<dd>@Html.Encode(Model.EmployeeName)</dd>
</dl>
}
</div>
@@ -1,5 +1,4 @@
@using System.Xml @using MileageTraker.Web.Models
@using MileageTraker.Web.Models
@using MileageTraker.Web.Utility @using MileageTraker.Web.Utility
@model MileageTraker.Web.ViewModels.Log.LogResultsViewModel @model MileageTraker.Web.ViewModels.Log.LogResultsViewModel
@{ @{
@@ -33,7 +32,7 @@
@Html.TextBoxFor(m => m.VehicleId, new {@class="search-query input-mini", placeholder="Vehicle"}) @Html.TextBoxFor(m => m.VehicleId, new {@class="search-query input-mini", placeholder="Vehicle"})
</div> </div>
<div class="span4"> <div class="span4">
@Html.Label("EmployeeName", "User") @Html.Label("EmployeeName", "Driver")
@Html.TextBoxFor(m => m.EmployeeName, new {@class="search-query input-small", placeholder="User"}) @Html.TextBoxFor(m => m.EmployeeName, new {@class="search-query input-small", placeholder="User"})
</div> </div>
</div> </div>
+2 -1
View File
@@ -263,6 +263,7 @@
<Content Include="Views\Shared\EditorTemplates\HttpPostedFileBase.cshtml" /> <Content Include="Views\Shared\EditorTemplates\HttpPostedFileBase.cshtml" />
<Content Include="Views\City\Index.cshtml" /> <Content Include="Views\City\Index.cshtml" />
<Content Include="Views\City\Create.cshtml" /> <Content Include="Views\City\Create.cshtml" />
<Content Include="Views\Shared\DisplayTemplates\LogQueryViewModel.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Content\Account.Login.css" /> <Content Include="Content\Account.Login.css" />
@@ -332,7 +333,7 @@
<Content Include="Views\Shared\Error.cshtml" /> <Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.cshtml" /> <Content Include="Views\Shared\_Layout.cshtml" />
<Content Include="Views\Web.config" /> <Content Include="Views\Web.config" />
<Content Include="Views\Log\BackToLogs.cshtml" /> <Content Include="Views\Shared\BackToLogs.cshtml" />
<Content Include="Views\Vehicle\BackToVehicles.cshtml" /> <Content Include="Views\Vehicle\BackToVehicles.cshtml" />
<Content Include="Views\Shared\EditorTemplates\Date.cshtml" /> <Content Include="Views\Shared\EditorTemplates\Date.cshtml" />
<Content Include="Views\Shared\DisplayTemplates\Date.cshtml" /> <Content Include="Views\Shared\DisplayTemplates\Date.cshtml" />