Finish confirm page

This commit is contained in:
2012-12-16 15:06:57 -05:00
parent 7f7ae6d3c2
commit 5be12d783b
8 changed files with 120 additions and 79 deletions
+72 -49
View File
@@ -1,9 +1,9 @@
@using MileageTraker.Web.Utility
@model MileageTraker.Web.ViewModels.ConfirmCreateLogViewModel
@{
ViewBag.Title = "Confirm";
Layout = "~/Views/Shared/_Layout.cshtml";
var endOdometerStyle = Model.PreviousOdometer != null ? "style=padding-bottom:0px;" : "";
}
@section Styles
{
@@ -17,69 +17,92 @@
<p class="alert">Please <strong>confirm</strong> - entry not complete until <strong>confirm</strong> clicked</p>
@if (Model.Miles == 0)
{
<p class="alert"><span class="label label-important">Warning</span> No mileage being logged - <strong>is this a duplicate?</strong></p>
<p class="alert"><span class="label label-warning">Warning</span> No mileage being logged - <strong>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>
<dl class="dl-horizontal vehicle-id">
<dt>
@Html.DisplayNameFor(m => m.VehicleId)
</dt>
<dd>
@Html.DisplayTextFor(m => m.VehicleId)
<span class="label @Model.VehicleColor">@Html.DisplayTextFor(m => m.VehicleType)</span>
</dd>
</dl>
@Html.HiddenFor(m => m.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)
<dl class="dl-horizontal endodometer">
<dt>
@Html.DisplayNameFor(m => m.EndOdometer)
</dt>
<dd>
@Html.DisplayTextFor(m => m.EndOdometer)
@if (Model.PreviousOdometer.HasValue)
{
<br/>
<span class="subscript @if (Model.Miles == 0)
{ <text>label label-warning</text>}">@Html.Encode(Model.Miles) miles since <br />
@Html.Encode(Model.PreviousOdometer) on @Html.Encode(Model.PreviousDate.Value.ToShortDateString())</span>
<small class="muted">
@if (Model.Miles > 0)
{
@Html.DisplayTextFor(m => m.Miles) <span>miles</span>
}
else
{
<span class="label label-warning">
@Html.DisplayTextFor(m => m.Miles) <span>miles</span>
</span>
}
since @Html.DisplayTextFor(m => m.PreviousOdometer)
on @Html.Encode(Model.PreviousDate.Value.ToShortDateString())
</small>
}
</div>
</div>
<input type="hidden" name="EndOdometer" value="@Html.AttributeEncode(Model.EndOdometer)" />
</dd>
</dl>
@Html.HiddenFor(m => m.EndOdometer)
@Html.DisplayFor(model => model.LogType)
@Html.HiddenFor(model => model.LogType.Value)
@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">
@Html.DisplayFor(model => model.EmployeeName)
@Html.HiddenFor(model => model.EmployeeName)
@Html.DisplayFor(model => model.CityName)
@Html.HiddenFor(model => model.CityName)
<dl class="dl-horizontal gas">
<dt>
@Html.DisplayNameFor(m => m.GasPurchased)
</dt>
<dd>
@if (!string.IsNullOrEmpty(Model.GasPurchased))
{
@Model.GasPurchased <span class="units">Gallons</span>
@Html.DisplayTextFor(m => m.GasPurchased) <small class="muted">Gallons</small>
}
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="muted">(@Html.Encode(Model.DateHowLongAgo))</span>
<input type="hidden" name="Date" value="@Html.AttributeEncode(Model.Date)" />
</div>
</div>
<input type="submit" name="Edit" value="Back" class="btn" />
<input type="submit" name="Confirm" value="Confirm" class="btn btn-primary" />
</dd>
</dl>
@Html.HiddenFor(model => model.GasPurchased)
<dl class="dl-horizontal date">
<dt>
@Html.DisplayNameFor(m => m.Date)
</dt>
<dd>
@Html.DisplayTextFor(m => m.Date)
<small class="muted">(@Html.DisplayTextFor(m => m.DateHowLongAgo))</small>
</dd>
</dl>
@Html.HiddenFor(model => model.Date)
<dl class="dl-horizontal">
<dt>
<input type="submit" name="Edit" value="Back" class="btn" />
</dt>
<dd>
<input type="submit" name="Confirm" value="Confirm" class="btn btn-primary" />
</dd>
</dl>
</fieldset>
}
+7 -15
View File
@@ -5,24 +5,16 @@
Layout = "~/Views/Shared/_Layout.cshtml";
}
@section Styles
{
<link href="@Url.Content("~/Content/CreateLog.Index.css")" rel="stylesheet" type="text/css" />
}
@{
@:<fieldset>
<legend>@ViewBag.Title</legend>
<h4>@ViewBag.Title</h4>
<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>
You've successfully created an entry
for <strong>@Html.DisplayTextFor(m => m.EmployeeName)</strong>
traveling to <strong>@Html.DisplayTextFor(m => m.CityName)</strong>
on <strong>@Html.DisplayTextFor(m => m.Date)</strong>
in Vehicle Id <strong>@Html.DisplayTextFor(m => m.VehicleId)</strong>
</p>
<p>
@Html.ActionLink("Create another", "Index", null, new { @class = "btn" })
@Html.ActionLink("Create another", "Index", null, new { @class = "btn" })
</p>
@:</fieldset>
}