Initial
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@using MileageTraker.Web.ViewModels
|
||||
@model LogResultsViewModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Logs";
|
||||
var grid = new WebGrid(Model.Logs, rowsPerPage: 45);
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
@section Styles {
|
||||
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
|
||||
}
|
||||
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
|
||||
|
||||
<p>
|
||||
@using (Html.BeginForm("Index", "Log", FormMethod.Get, new { id = "filter" }))
|
||||
{
|
||||
@Html.EditorForModel()
|
||||
<input type="submit" value="Filter" />
|
||||
}
|
||||
</p>
|
||||
<p>
|
||||
<div id="newLog">
|
||||
@Html.ActionLink("Vehicle Mileage", "MonthlyVehicleMileage", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, new { @class = "ui-button" })
|
||||
@Html.ActionLink("Employee Mileage", "MonthlyEmployeeMileage", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, new { @class = "ui-button" })
|
||||
@Html.ActionLink("Add New Log", "Create", null, new { @class = "ui-button" })
|
||||
@Html.ActionLink("Export", "Export", new { Year = Model.SelectedYear, Month = Model.SelectedMonth, LogType = Model.SelectedLogType }, new { @class = "ui-button" })
|
||||
</div>
|
||||
</p>
|
||||
|
||||
<div>
|
||||
@grid.GetHtml(columns:
|
||||
grid.Columns(
|
||||
grid.Column("VehicleId", "Vehicle ID", item => Html.ActionLink((string)item.VehicleId, "DetailsPartial", "Vehicle", new { id = item.VehicleId }, new { @class = "qtip-modal" })),
|
||||
grid.Column("EndOdometer", "End ODO"),
|
||||
grid.Column("Miles", canSort: false, format: item =>
|
||||
{
|
||||
if (item.PreviousLogId != null)
|
||||
{
|
||||
string miles = (item.EndOdometer - item.PreviousLogEndOdometer).ToString();
|
||||
return Html.ActionLink(miles, "DetailsPartial", new { id = item.PreviousLogId }, new { @class = "qtip-modal" });
|
||||
}
|
||||
return Html.Raw("<span class='miles-unknown'>?</span>");
|
||||
}),
|
||||
grid.Column("LogType", "Type", item => ((Enum)item.LogType).GetDisplayShortName()),
|
||||
grid.Column("GasPurchased", "Gas", item => item.GasPurchased > 0 ? String.Format("{0:0.000}", item.GasPurchased) : string.Empty),
|
||||
grid.Column("Date", format: item => item.Date.ToString("d")),
|
||||
grid.Column("CityName", "City Name"),
|
||||
grid.Column("EmployeeName", "Employee Name"),
|
||||
grid.Column(format: item => Html.ActionLink("Edit", "Edit", new { id = item.LogId })),
|
||||
grid.Column(format: item => Html.ActionLink("Details", "Details", new { id = item.LogId })),
|
||||
grid.Column(format: item => Html.ActionLink("Delete", "Delete", new { id = item.LogId }))
|
||||
)
|
||||
)
|
||||
</div>
|
||||
Reference in New Issue
Block a user