Initial
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.ConfirmCreateLogViewModel
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Confirm";
|
||||
var blackBerry = Request.IsBlackBerry();
|
||||
ViewBag.PageStyle = blackBerry ? "~/Content/CreateLog/BlackBerry.css" : "~/Content/CreateLog/Index.css";
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
var endOdometerStyle = Model.PreviousOdometer != null ? "style=padding-bottom:0px;" : "";
|
||||
}
|
||||
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
|
||||
|
||||
@using (Html.BeginForm("Action", "CreateLog", FormMethod.Post))
|
||||
{
|
||||
if (!blackBerry)
|
||||
{
|
||||
@:<fieldset>
|
||||
<legend>@ViewBag.Title</legend>
|
||||
}
|
||||
<p class="warning">Please <strong>confirm</strong> - entry not complete until <strong>confirm</strong> clicked</p>
|
||||
if (Model.Miles == 0)
|
||||
{
|
||||
<p class="warning"><strong>Warning - 0 miles are logged - is this a duplicate?</strong></p>
|
||||
}
|
||||
<div class="display-field-container vehicle-id">
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.VehicleId)
|
||||
</div>
|
||||
<div class="display-field @Model.VehicleColor">
|
||||
@Html.Encode(Model.VehicleId) <span class="subscript">(@Model.VehicleType)</span>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="VehicleId" value="@Html.AttributeEncode(Model.VehicleId)" />
|
||||
<div class="display-field-container endodometer" @endOdometerStyle>
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.EndOdometer)
|
||||
</div>
|
||||
<div class="display-field">
|
||||
@Html.Encode(Model.EndOdometer)
|
||||
@if (Model.PreviousOdometer != null)
|
||||
{
|
||||
<br/>
|
||||
<span class="subscript @if (Model.Miles == 0)
|
||||
{ <text>warning error</text>}">@Html.Encode(Model.Miles) miles since <br />
|
||||
@Html.Encode(Model.PreviousOdometer) on @Html.Encode(Model.PreviousDate.Value.ToShortDateString())</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="EndOdometer" value="@Html.AttributeEncode(Model.EndOdometer)" />
|
||||
@Html.DisplayFor(model => model.LogType)
|
||||
<input type="hidden" name="LogType.Enum" value="@Html.AttributeEncode(Model.LogType.Enum)" />
|
||||
@Html.DisplayFor(model => model.EmployeeName)
|
||||
<input type="hidden" name="EmployeeName" value="@Html.AttributeEncode(Model.EmployeeName)" />
|
||||
@Html.DisplayFor(model => model.CityName)
|
||||
<input type="hidden" name="CityName" value="@Html.AttributeEncode(Model.CityName)" />
|
||||
|
||||
<div class="display-field-container gas">
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.GasPurchased)
|
||||
</div>
|
||||
<div class="display-field">
|
||||
@if (!string.IsNullOrEmpty(Model.GasPurchased))
|
||||
{
|
||||
@Model.GasPurchased <span class="units">Gallons</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<text>No Gas Purchased</text>
|
||||
}
|
||||
<input type="hidden" name="GasPurchased" value="@Html.AttributeEncode(Model.GasPurchased)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="display-field-container date">
|
||||
<div class="display-label">
|
||||
@Html.LabelFor(model => model.Date)
|
||||
</div>
|
||||
<div class="display-field">
|
||||
@Html.Encode(Model.Date)
|
||||
<span class="subscript">(@Html.Encode(Model.DateHowLongAgo))</span>
|
||||
<input type="hidden" name="Date" value="@Html.AttributeEncode(Model.Date)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="submit">
|
||||
<input type="submit" name="Edit" value="Back" />
|
||||
<input type="submit" name="Confirm" value="Confirm" />
|
||||
</div>
|
||||
if (!blackBerry)
|
||||
{
|
||||
@:</fieldset>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.CreateLogViewModel
|
||||
@{
|
||||
|
||||
ViewBag.Title = "Enter Mileage Log";
|
||||
var blackBerry = Request.IsBlackBerry();
|
||||
ViewBag.PageStyle = blackBerry ? "~/Content/CreateLog/BlackBerry.css" : "~/Content/CreateLog/Index.css";
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
}
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
|
||||
|
||||
@using (Html.BeginForm("Index", "CreateLog", FormMethod.Post))
|
||||
{
|
||||
if (!blackBerry) {
|
||||
@:<fieldset>
|
||||
<legend>@ViewBag.Title</legend>
|
||||
}
|
||||
@Html.ValidationSummary(true)
|
||||
@Html.EditorForModel()
|
||||
<div class="submit">
|
||||
<input type="submit" value="Submit" />
|
||||
</div>
|
||||
if (!blackBerry)
|
||||
{
|
||||
@:</fieldset>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@using MileageTraker.Web.Utility
|
||||
@model IEnumerable<Log>
|
||||
|
||||
@if (Model.Any())
|
||||
{
|
||||
<h4>Recent Logs for @ViewData["employeeName"]</h4>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
Date
|
||||
</th>
|
||||
<th>
|
||||
City
|
||||
</th>
|
||||
<th>
|
||||
End ODO
|
||||
</th>
|
||||
<th>
|
||||
Type
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var log in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.Encode(log.Date.ToShortDateString())
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.CityName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.EndOdometer)
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.LogType.Enum.GetDisplayName())
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4>Mileage history not found for for "@ViewData["employeeName"]"</h4>
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.CreateLogViewModel
|
||||
@{
|
||||
|
||||
ViewBag.Title = "Success";
|
||||
var blackBerry = Request.IsBlackBerry();
|
||||
ViewBag.PageStyle = blackBerry ? "~/Content/CreateLog/BlackBerry.css" : "~/Content/CreateLog/Index.css";
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
}
|
||||
|
||||
@if (!blackBerry) {
|
||||
@:<fieldset>
|
||||
<legend>@ViewBag.Title</legend>
|
||||
}
|
||||
<p>
|
||||
You've successfully created an entry
|
||||
for <strong>@Html.Encode(Model.EmployeeName)</strong>
|
||||
traveling to <strong>@Html.Encode(Model.CityName)</strong>
|
||||
on <strong>@Html.Encode(Model.Date)</strong>
|
||||
in VehicleId <strong>@Html.Encode(Model.VehicleId)</strong>
|
||||
</p>
|
||||
<p>
|
||||
@Html.ActionLink("Create another", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@if (!blackBerry)
|
||||
{
|
||||
@:</fieldset>
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
@{
|
||||
ViewBag.Title = "About Us";
|
||||
}
|
||||
|
||||
<h2>About</h2>
|
||||
<p>
|
||||
Put content here.
|
||||
</p>
|
||||
@@ -0,0 +1,25 @@
|
||||
@model MileageTraker.Web.Models.Log
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Create Log";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
|
||||
@using (Html.BeginForm()) {
|
||||
@Html.ValidationSummary(true)
|
||||
<fieldset>
|
||||
<legend>Log</legend>
|
||||
@Html.EditorForModel()
|
||||
<p>
|
||||
<input type="submit" value="Create" />
|
||||
</p>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
<p>
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@@ -0,0 +1,19 @@
|
||||
@model MileageTraker.Web.Models.Log
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Delete Log";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<fieldset>
|
||||
<legend>Log</legend>
|
||||
@Html.DisplayForModel()
|
||||
</fieldset>
|
||||
@using (Html.BeginForm()) {
|
||||
<p>
|
||||
<input type="submit" value="Delete" />
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
@model MileageTraker.Web.Models.Log
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Log Details";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
<p>
|
||||
@Html.ActionLink("Previous", "PreviousDetails", new { id = Model.LogId }, new { @class = "ui-button" })
|
||||
@Html.ActionLink("Next", "NextDetails", new { id = Model.LogId }, new { @class = "ui-button" })
|
||||
@if(TempData["Message"] != null) {
|
||||
<span class="ui-message ui-state-highlight ui-corner-all">@TempData["Message"]</span>
|
||||
}
|
||||
</p>
|
||||
|
||||
<fieldset>
|
||||
<legend>Log</legend>
|
||||
@Html.DisplayForModel()
|
||||
</fieldset>
|
||||
<p>
|
||||
@Html.ActionLink("Edit", "Edit", new { id = Model.LogId }, new { @class = "ui-button" })
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@@ -0,0 +1,10 @@
|
||||
@using MileageTraker.Web.ViewModels
|
||||
@model LogPartialDetails
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
<h5>Previous Log</h5>
|
||||
@Html.DisplayForModel()
|
||||
<p>
|
||||
@Html.ActionLink("Details", "Details", new { id = Model.LogId })
|
||||
</p>
|
||||
@@ -0,0 +1,27 @@
|
||||
@model MileageTraker.Web.Models.Log
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Edit Log";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
|
||||
@using (Html.BeginForm()) {
|
||||
@Html.ValidationSummary(true)
|
||||
<fieldset>
|
||||
<legend>Log</legend>
|
||||
|
||||
@Html.EditorForModel()
|
||||
|
||||
<p>
|
||||
<input type="submit" value="Save" />
|
||||
</p>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
<p>
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@@ -0,0 +1,8 @@
|
||||
@{
|
||||
ViewBag.Title = "No Logs";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
<div>
|
||||
No logs have been added. @Html.ActionLink("Create Log", "Create", null, new { @class = "ui-button" }).
|
||||
</div>
|
||||
@@ -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>
|
||||
@@ -0,0 +1,48 @@
|
||||
@using System.Globalization
|
||||
@using MileageTraker.Web.Models
|
||||
@model IEnumerable<Tuple<Log, Log>>
|
||||
|
||||
<div class="report-calculation">
|
||||
<table>
|
||||
<thead><tr><th>Date</th><th>City</th><th>End ODO</th><th>Start ODO</th><th>Miles</th></tr></thead>
|
||||
@foreach (var log in Model)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.Encode(log.Item2.Date.ToShortDateString())
|
||||
</td>
|
||||
<td>
|
||||
@Html.Encode(log.Item2.CityName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(log.Item2.EndOdometer.ToString(CultureInfo.InvariantCulture), "Details", "Log", new {id = log.Item2.LogId}, null)
|
||||
</td>
|
||||
|
||||
@if (log.Item1 != null)
|
||||
{
|
||||
<td>
|
||||
@Html.ActionLink(log.Item1.EndOdometer.ToString(CultureInfo.InvariantCulture), "Details", "Log", new {id = log.Item1.LogId}, null)
|
||||
</td>
|
||||
<td>
|
||||
@(log.Item2.EndOdometer - log.Item1.EndOdometer)
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td colspan="2">
|
||||
<span class="ui-state-error">?</span>
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
Total:</td>
|
||||
<td>
|
||||
@Model.Sum(log => log.Item1 != null ? log.Item2.EndOdometer - log.Item1.EndOdometer : 0)
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
@@ -0,0 +1,54 @@
|
||||
@model MileageTraker.Web.ViewModels.EmployeeMileageViewModel
|
||||
@{
|
||||
ViewBag.Title = "Employee Mileage Report";
|
||||
}
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
|
||||
|
||||
<p class="no-print">
|
||||
@Html.ActionLink("Logs", "Index", "Log", Model.Query, new { @class = "ui-button" })
|
||||
</p>
|
||||
@Html.DisplayFor(m => m.Query.Year)
|
||||
@Html.DisplayFor(m => m.Query.Month)
|
||||
@if (Model.Query.LogType.HasValue)
|
||||
{
|
||||
@Html.DisplayFor(m => m.Query.LogType)
|
||||
}
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Employee
|
||||
</th>
|
||||
<th>
|
||||
Trips
|
||||
</th>
|
||||
<th>
|
||||
Total Miles
|
||||
</th>
|
||||
<th>
|
||||
Total Gas Purchased
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.Items)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.EmployeeName)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.TripCount)
|
||||
</td>
|
||||
<td @if (item.LogPairs.Any(lp => lp.Item1 == null)){
|
||||
@:class="ui-state-error"
|
||||
}>
|
||||
<span class="report-miles">@Html.DisplayTextFor(i => item.Miles) <span class="ui-icon ui-icon-triangle-1-n"></span></span>
|
||||
@Html.Partial("LogsSummary", item.LogPairs)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.GasPurchased)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tfoot><tr><td colspan="2">Total:</td><td>@Html.DisplayTextFor(m => m.TotalMiles)</td><td>@Html.DisplayTextFor(m => m.TotalGasPurchased)</td></tr></tfoot>
|
||||
</table>
|
||||
@@ -0,0 +1,55 @@
|
||||
@using System.Globalization
|
||||
@model MileageTraker.Web.ViewModels.VehicleMileageViewModel
|
||||
@{
|
||||
ViewBag.Title = "Vehicle Mileage Report";
|
||||
}
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery.qtip-1.0.0-rc3.min.js")" type="text/javascript"></script>
|
||||
|
||||
<p class="no-print">
|
||||
@Html.ActionLink("Logs", "Index", "Log", Model.Query, new { @class = "ui-button" })
|
||||
</p>
|
||||
@Html.DisplayFor(m => m.Query.Year)
|
||||
@Html.DisplayFor(m => m.Query.Month)
|
||||
@if (Model.Query.LogType.HasValue)
|
||||
{
|
||||
@Html.DisplayFor(m => m.Query.LogType)
|
||||
}
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Vehicle Id
|
||||
</th>
|
||||
<th>
|
||||
Prog
|
||||
</th>
|
||||
<th>
|
||||
Total Miles
|
||||
</th>
|
||||
<th>
|
||||
Total Gas Purchased
|
||||
</th>
|
||||
</tr>
|
||||
@foreach (var item in Model.Items)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
@Html.ActionLink(item.VehicleId, "Details", "Vehicle", new { id = item.VehicleId }, null)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.Prog)
|
||||
</td>
|
||||
<td @if (item.LogPairs.Any(lp => lp.Item1 == null)){
|
||||
@:class="ui-state-error"
|
||||
}>
|
||||
<span class="report-miles">@Html.DisplayTextFor(i => item.Miles) <span class="ui-icon ui-icon-triangle-1-n"></span></span>
|
||||
@Html.Partial("LogsSummary", item.LogPairs)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(i => item.GasPurchased)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
<tfoot><tr><td colspan="2">Total:</td><td>@Html.DisplayTextFor(m => m.TotalMiles)</td><td>@Html.DisplayTextFor(m => m.TotalGasPurchased)</td></tr></tfoot>
|
||||
</table>
|
||||
@@ -0,0 +1,5 @@
|
||||
@model DateTime
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Encode(string.Format(ViewData.ModelMetadata.DisplayFormatString, Model))
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Encode(Model)
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Encode(Model)
|
||||
@@ -0,0 +1,7 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageLogTypeWrapper
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Encode(Model.Enum.GetDisplayName())
|
||||
@@ -0,0 +1,8 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForDisplay && !pm.HideSurroundingHtml && !pm.ModelType.IsCollection()))
|
||||
{
|
||||
@Html.Display(prop.PropertyName)
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/DisplayTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.Encode(Model)
|
||||
@@ -0,0 +1,20 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@{
|
||||
Layout = null;
|
||||
var lowerPropertyName = @CustomExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
|
||||
var units = (string)ViewData.ModelMetadata.AdditionalValues["Units"];
|
||||
var color = ViewData.ModelMetadata.PropertyName == "Color" ? Model : "";
|
||||
}
|
||||
|
||||
<div class="display-field-container @lowerPropertyName">
|
||||
<div class="display-label">
|
||||
@Html.LabelForModel()
|
||||
</div>
|
||||
<div class="display-field @color">
|
||||
@RenderBody()
|
||||
@if (!string.IsNullOrEmpty(units))
|
||||
{
|
||||
<span class="units">@units</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
@model DateTime
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.TextBox("", (Model != DateTime.MinValue ? Model.ToShortDateString() : string.Empty ))
|
||||
@@ -0,0 +1,4 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
@@ -0,0 +1,18 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model Enum
|
||||
@{
|
||||
var listItems = Model.GetSelectListItems();
|
||||
var prefix = ViewData.TemplateInfo.HtmlFieldPrefix;
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = string.Empty;
|
||||
var index = 0;
|
||||
|
||||
foreach (var li in listItems)
|
||||
{
|
||||
var fieldName = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}", prefix.Replace('.', '_'), index++);
|
||||
<span class="radiobutton">
|
||||
@Html.RadioButton(prefix, li.Value, li.Selected, new { @id = fieldName })
|
||||
@Html.Label(fieldName, li.Text)
|
||||
</span>
|
||||
}
|
||||
ViewData.TemplateInfo.HtmlFieldPrefix = prefix;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@model Enum
|
||||
@{
|
||||
var emptyItem = new SelectListItem{Text="Type", Value=""};
|
||||
var listItems = new []{emptyItem}.Concat(Model.GetSelectListItems());
|
||||
@Html.ListBox("", listItems)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
@Html.Hidden("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
@@ -0,0 +1,7 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@using MileageTraker.Web.Utility
|
||||
@model MileageTraker.Web.ViewModels.LogResultsViewModel
|
||||
|
||||
@Html.DropDownList("Year", new SelectList(Model.Years, Model.SelectedYear))
|
||||
@Html.DropDownList("Month", new SelectList(Model.Months, Model.SelectedMonth))
|
||||
@Html.DropDownList("LogType", typeof(MileageLogType).ToSelectList(Model.SelectedLogType, "Log Type"))
|
||||
@@ -0,0 +1,6 @@
|
||||
@using MileageTraker.Web.Models
|
||||
@model MileageLogTypeWrapper
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@Html.EditorFor(model => model.Enum, "Enum")
|
||||
@@ -0,0 +1,8 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@foreach (var prop in ViewData.ModelMetadata.Properties.Where(pm => pm.ShowForEdit && !pm.ModelType.IsCollection()))
|
||||
{
|
||||
@Html.Editor(prop.PropertyName)
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
}
|
||||
@if (!(Model is Enum))
|
||||
{
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue)
|
||||
}
|
||||
else
|
||||
{
|
||||
@Html.Editor("", "Enum")
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
@{
|
||||
Layout = null;
|
||||
var lowerPropertyName = @CustomExtensions.LowercaseFirst(ViewData.ModelMetadata.PropertyName);
|
||||
var units = (string)ViewData.ModelMetadata.AdditionalValues["Units"];
|
||||
var formatHint = (string)ViewData.ModelMetadata.AdditionalValues["FormatHint"];
|
||||
var editLabel = (bool)ViewData.ModelMetadata.AdditionalValues["EditLabel"];
|
||||
}
|
||||
|
||||
<div class="editor-field-container @lowerPropertyName">
|
||||
@if (editLabel) {
|
||||
<div class="editor-label">
|
||||
@Html.LabelForModel()
|
||||
</div>
|
||||
}
|
||||
<div class="editor-field">
|
||||
@RenderBody()
|
||||
@if (!string.IsNullOrEmpty(units)) {
|
||||
<span class="units">@units</span>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(formatHint)) {
|
||||
<div class="format-hint">@formatHint</div>
|
||||
}
|
||||
@Html.ValidationMessage("")
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,13 @@
|
||||
@model HandleErrorInfo
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Error";
|
||||
if (Model.ControllerName == "CreateLog")
|
||||
{
|
||||
Layout = "~/Views/Shared/_Layout.min.cshtml";
|
||||
}
|
||||
}
|
||||
|
||||
<h2>
|
||||
Sorry, an error occurred while processing your request.
|
||||
</h2>
|
||||
@@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mileage Traker - ETHRA - @ViewBag.Title</title>
|
||||
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
|
||||
<link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui-1.8.13.custom.css")" rel="stylesheet" type="text/css" />
|
||||
@RenderSection("Styles", false)
|
||||
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.13.custom.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page">
|
||||
<div id="header">
|
||||
<div id="title">
|
||||
<a href="/"><img src="/Content/Header.png" alt="Mileage Traker - ETHRA" width="452" height="89" /></a>
|
||||
</div>
|
||||
<div id="menucontainer">
|
||||
<ul id="menu">
|
||||
<li>
|
||||
@Html.ActionLink("Logs", "Index", "Log")</li>
|
||||
<li>
|
||||
@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div id="main">
|
||||
@RenderBody()
|
||||
</div>
|
||||
<div id="footer">
|
||||
Mileage Traker © 2012 James Kolpack
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,38 @@
|
||||
@using MileageTraker.Web.Utility
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Mileage Traker - ETHRA - @ViewBag.Title</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||
<link href="@Url.Content("~/Content/Site.min.css")" rel="stylesheet" type="text/css" />
|
||||
@if (Request.IsBlackBerry())
|
||||
{
|
||||
<link href="@Url.Content("~/Content/BlackBerry.css")" rel="stylesheet" type="text/css" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<link href="@Url.Content("~/Content/themes/custom-theme/jquery-ui-1.8.13.custom.css")" rel="stylesheet" type="text/css" />
|
||||
}
|
||||
@if (ViewBag.PageStyle != null)
|
||||
{
|
||||
<link href="@Url.Content(ViewBag.PageStyle)" rel="stylesheet" type="text/css" />
|
||||
}
|
||||
<script src="@Url.Content("~/Scripts/jquery-1.7.2.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.numeric.js")" type="text/javascript"></script>
|
||||
@if (!Request.IsBlackBerry())
|
||||
{
|
||||
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.13.custom.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/Shared/Site.js")" type="text/javascript"></script>
|
||||
}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@if (!Request.IsBlackBerry())
|
||||
{
|
||||
<div id="header">
|
||||
<img src="@Url.Content("~/Content/Header_white.png")" alt="Mileage Traker" />
|
||||
</div>
|
||||
}
|
||||
@RenderBody()
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
@model MileageTraker.Web.Models.Vehicle
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Create Vehicle";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
|
||||
@using (Html.BeginForm()) {
|
||||
@Html.ValidationSummary(true)
|
||||
<fieldset>
|
||||
<legend>Vehicle</legend>
|
||||
@Html.EditorForModel()
|
||||
|
||||
<p>
|
||||
<input type="submit" value="Create" />
|
||||
</p>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
<p>
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@@ -0,0 +1,20 @@
|
||||
@model MileageTraker.Web.Models.Vehicle
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Vehicle Details";
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<fieldset>
|
||||
<legend>Vehicle</legend>
|
||||
@Html.DisplayForModel()
|
||||
</fieldset>
|
||||
<p>
|
||||
@Html.ActionLink("Edit", "Edit", new { id = Model.VehicleId }, new { @class = "ui-button" })
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@@ -0,0 +1,8 @@
|
||||
@model MileageTraker.Web.ViewModels.VehiclePartialDetails
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
@Html.DisplayForModel()
|
||||
<p>
|
||||
@Html.ActionLink("Details", "Details", new { id = Model.VehicleId })
|
||||
</p>
|
||||
@@ -0,0 +1,26 @@
|
||||
@model MileageTraker.Web.Models.Vehicle
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Edit Vehicle";
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
|
||||
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
|
||||
|
||||
@using (Html.BeginForm()) {
|
||||
@Html.ValidationSummary(true)
|
||||
<fieldset>
|
||||
<legend>Vehicle</legend>
|
||||
@Html.EditorForModel()
|
||||
|
||||
<p>
|
||||
<input type="submit" value="Save" />
|
||||
</p>
|
||||
</fieldset>
|
||||
}
|
||||
|
||||
<p>
|
||||
@Html.ActionLink("Back to List", "Index", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
@@ -0,0 +1,94 @@
|
||||
@model IEnumerable<MileageTraker.Web.Models.Vehicle>
|
||||
|
||||
@{
|
||||
ViewBag.Title = "Vehicles";
|
||||
}
|
||||
|
||||
@section Styles {
|
||||
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
|
||||
}
|
||||
|
||||
<h2>@ViewBag.Title</h2>
|
||||
|
||||
<p>
|
||||
@Html.ActionLink("Add another vehicle", "Create", null, new{@class="ui-button"})
|
||||
@Html.ActionLink("Export", "Export", null, new { @class = "ui-button" })
|
||||
</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th>
|
||||
Key
|
||||
</th>
|
||||
<th>
|
||||
EthraId
|
||||
</th>
|
||||
<th>
|
||||
Model Yr
|
||||
</th>
|
||||
<th>
|
||||
Make
|
||||
</th>
|
||||
<th>
|
||||
Model
|
||||
</th>
|
||||
<th>
|
||||
Type
|
||||
</th>
|
||||
<th>
|
||||
TagNumber
|
||||
</th>
|
||||
<th>
|
||||
Prog
|
||||
</th>
|
||||
<th>
|
||||
Assigned
|
||||
</th>
|
||||
<th>
|
||||
ODO
|
||||
</th>
|
||||
<th></th><th></th><th></th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.Key)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.VehicleId)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.ModelYear)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.Make)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.CarModel)
|
||||
</td>
|
||||
<td class="@item.Color">
|
||||
@Html.DisplayTextFor(m => item.Type)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.TagNumber)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.Prog)
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.Assigned) @if(!string.IsNullOrEmpty(item.Notes)) {
|
||||
<span class="format-hint">@Html.DisplayTextFor(m => item.Notes)</span>
|
||||
}
|
||||
</td>
|
||||
<td>
|
||||
@Html.DisplayTextFor(m => item.CurrentOdometer)
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink("Edit", "Edit", new { id=item.VehicleId }) </td>
|
||||
<td> @Html.ActionLink("Details", "Details", new { id=item.VehicleId }) </td>
|
||||
<td> @Html.ActionLink("New log", "Create", "Log", new { vehicleId = item.VehicleId }, null)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
|
||||
</table>
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<add path="*" verb="*" type="System.Web.HttpNotFoundHandler"/>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
|
||||
<handlers>
|
||||
<remove name="BlockViewHandler"/>
|
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
@@ -0,0 +1,3 @@
|
||||
@{
|
||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||
}
|
||||
Reference in New Issue
Block a user