Improved filtering implemented.

This commit is contained in:
2014-05-16 18:23:18 -04:00
parent b2d57a9e5f
commit fe0bc4e9ff
14 changed files with 425 additions and 133 deletions
+24 -13
View File
@@ -8,22 +8,33 @@
@section Styles {
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
}
@section Scripts {
<script type="text/javascript">
var availableLogYearMonths = @Html.Raw(Json.Encode(Model.AvailableYearMonths));
@if (Model.Year != null)
{
<text>var selectedYear = "@Model.Year";</text>
<text>var selectedMonth = "@Model.Month";</text>
}
</script>
}
@Html.Partial("_StatusMessage")
<div class="btn-toolbar pull-right">
@using (Html.BeginForm("Index", "Log", FormMethod.Get, new { id = "filter", @class = "form" }))
{
<div class="">
@Html.EditorForModel()
</div>
}
</div>
<h2 id="log-title">@ViewBag.Title</h2>
<div class="btn-toolbar">
@using (Html.BeginForm("Index", "Log", FormMethod.Get, new { id = "filter", @class = "form-inline" }))
{
<div class="input-append pull-right">
@Html.EditorForModel()
<input type="submit" value="Filter" class="btn" />
</div>
}
<div class="btn-toolbar clearfix">
@Html.ActionLink("Add New Log", "Create", null, new { @class = "btn" })
@Html.ActionLink("Export", "Export", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, 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("Purposes", "Index", "Purpose", null, new { @class = "btn" })
@Html.ActionLink("Import", "ImportUpload", null, new { @class = "btn"})
@@ -31,10 +42,10 @@
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Report <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType })
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", new { Year = Model.Year, Month = Model.Month, LogType = Model.LogType })
</li>
<li>
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType })
@Html.ActionLink("Driver Mileage", "MonthlyDriverMileage", new { Year = Model.Year, Month = Model.Month, LogType = Model.LogType })
</li>
</ul>
</div>
@@ -67,7 +78,7 @@
return item.PurposePurpose;
}),
grid.Column("Driver Name", format: item => item.UserFullName),
grid.Column(format:
grid.Column("Total Results: " + Model.Logs.Count(), canSort:false, format:
@<div class='btn-group'>
@Html.ActionLink("Edit", "Edit", new { id = item.LogId }, new { @class = "btn btn-mini" })
@Html.ActionLink("Details", "Details", new { id = item.LogId }, new { @class = "btn btn-mini" })
@@ -1,7 +1,39 @@
@using MileageTraker.Web.Models
@using System.Xml
@using MileageTraker.Web.Models
@using MileageTraker.Web.Utility
@model MileageTraker.Web.ViewModels.Log.LogResultsViewModel
@{
var show = Model.SecondRowSet;
}
@Html.DropDownList("Year", new SelectList(Model.Years, Model.SelectedYear), new { @class = "input-small" })
@Html.DropDownList("Month", new SelectList(Model.Months, Model.SelectedMonth), new { @class = "input-mini" })
@Html.DropDownList("LogType", typeof(MileageLogType).ToSelectList(Model.SelectedLogType, "Log Type"), new { @class = "input-medium" })
<div class="row-fluid">
<div class="span4">
@Html.Label("Year", "Year")
@Html.DropDownList("Year", new SelectList(Model.AvailableYearMonths.Keys, Model.Year), "Select Year", new { @class = "input-small" })
</div>
<div class="span3">
@Html.Label("Month", "Month")
@Html.DropDownList("Month", new SelectList(Model.SelectedYearMonths, Model.Month), "Select Month", new { @class = "input-mini" })
</div>
<div class="span3">
@Html.Label("MonthRange", "Range")
@Html.DropDownList("MonthRange", new SelectList(Enumerable.Range(1,12), Model.MonthRange), new { @class = "input-mini" })
</div>
<div class="span2">
<input type="submit" value="Filter" class="btn" style="margin-top:1.75em" />
</div>
</div>
<div class="row-fluid@{ if (show) {<text> show</text>} }">
<div class="span5">
@Html.Label("LogType", "Log Type")
@Html.DropDownList("LogType", typeof(MileageLogType).ToSelectList(Model.LogType, "Log Type"), new { @class = "input-medium" })
</div>
<div class="span3">
@Html.Label("VehicleId", "Vehicle")
@Html.TextBoxFor(m => m.VehicleId, new {@class="search-query input-mini", placeholder="Vehicle"})
</div>
<div class="span4">
@Html.Label("EmployeeName", "User")
@Html.TextBoxFor(m => m.EmployeeName, new {@class="search-query input-small", placeholder="User"})
</div>
</div>