More Progress

This commit is contained in:
2012-12-12 21:41:38 -05:00
parent 14d8054f22
commit 260118ff90
23 changed files with 114 additions and 94 deletions
+9 -6
View File
@@ -1,9 +1,5 @@
body {
padding-top: 49px;
}
#content {
padding: .5em 1em;
padding-top: 60px;
}
.brand
@@ -14,7 +10,7 @@
}
.navbar .brand {
margin-left: 20px;
margin-left: 10px;
margin-right: -20px;
}
@@ -42,4 +38,11 @@ footer {
.report-calculation
{
display: none;
}
@media print {
header,
footer,
.no-print
{ display:none }
}
+9 -1
View File
@@ -14,10 +14,18 @@
}
.navbar .brand {
margin-left: 20px;
margin-left: 10px;
margin-right: -20px;
}
.nav li {
line-height: 29px;
}
.form-horizontal .control-label {
width: 120px;
}
.form-horizontal .controls {
margin-left: 140px;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

+3
View File
@@ -41,6 +41,9 @@ namespace MileageTraker.Web.Controllers
SelectedMonth = query.Month.Value,
SelectedLogType = query.LogType.ToString()
};
Session.Add("LogPage", Request.Url.PathAndQuery);
return View(viewModel);
}
+2 -1
View File
@@ -59,10 +59,11 @@ namespace MileageTraker.Web.Models
[Required]
[Display(Name = "Tag#")]
[InputSize("small")]
public string TagNumber { get; set; }
[Required]
[InputSize("small")]
[InputSize("medium")]
public string Prog { get; set; }
[RegularExpression(@"Unassigned|[A-Za-z().]+(\s+[A-Za-z().]+)+", ErrorMessage = "Please enter the full name")]
+16 -5
View File
@@ -29,7 +29,7 @@
});
});
$("input#ModelYear,input#Price,input#VehicleId,input#EndOdometer,input#GasPurchased").numeric();
$(".report-miles").each(function () {
$(".report-miles").append('&nbsp;<span class="muted">&#9652;</span>').each(function () {
var content = $(this).next('.report-calculation');
$(this).qtip({
content: content,
@@ -38,13 +38,17 @@
delay: 1000
},
style: {
width: 400,
width: 520,
classes: "qtip-light"
}
},
position: {
my: "top right",
at: "bottom left"
},
});
});
$(".miles-unknown").addClass('ui-state-error').append('<span class="ui-icon ui-icon-triangle-1-n"/>')
$(".miles-unknown").addClass('ui-state-error').append('&nbsp;<span class="muted">&#9652;</span>')
.each(function () {
$(this).qtip({
content: "No previous log for this vehicle",
@@ -85,6 +89,10 @@
width: 320,
classes: 'qtip-light'
},
position: {
my: "top right",
at: "bottom left"
},
hide: {
fixed: true,
delay: 500
@@ -135,7 +143,7 @@ function bindQtipModal(element) {
element.click(function () { return false; });
element.append('&nbsp;<i class="icon-chevron-up" />');
element.append('&nbsp;<span class="muted">&#9652;</span>');
element.qtip({
content: {
@@ -151,6 +159,9 @@ function bindQtipModal(element) {
style: {
classes: 'qtip-light qtip-shadow',
width: 300
},
position: {
viewport: $(window)
}
});
}
+5 -5
View File
@@ -9,12 +9,12 @@ namespace MileageTraker.Web.Utility
{
if (filterContext != null)
{
string controller = filterContext.RouteData.Values["controller"].ToString();
string action = filterContext.RouteData.Values["action"].ToString();
string loggerName = string.Format("{0}Controller.{1}", controller, action);
string @params = string.Join(", ", filterContext.ActionParameters.Select(i => i.Key + ": " + i.Value));
var controller = filterContext.RouteData.Values["controller"].ToString();
var action = filterContext.RouteData.Values["action"].ToString();
var loggerName = string.Format("{0}Controller.{1}", controller, action);
var @params = string.Join(", ", filterContext.ActionParameters.Select(i => i.Key + ": " + i.Value));
string hostAddress = "UserHostAddress: " + filterContext.HttpContext.Request.UserHostAddress;
var hostAddress = "UserHostAddress: " + filterContext.HttpContext.Request.UserHostAddress;
log4net.LogManager.GetLogger(loggerName).Info(hostAddress + ", " + @params);
}
@@ -1,18 +0,0 @@
using System.Reflection;
using System.Web.Mvc;
namespace MileageTraker.Web.Utility
{
public class RequireRequestValueAttribute : ActionMethodSelectorAttribute
{
public RequireRequestValueAttribute(string valueName)
{
ValueName = valueName;
}
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
{
return (controllerContext.HttpContext.Request[ValueName] != null);
}
public string ValueName { get; private set; }
}
}
+5
View File
@@ -0,0 +1,5 @@
@if (Session["LogPage"] != null) {
<ul class="no-print breadcrumb">
<li><a href="@Session["LogPage"]">&larr; Back To Logs</a></li>
</ul>
}
+7 -7
View File
@@ -14,19 +14,19 @@
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
<h2>@ViewBag.Title</h2>
@{ Html.RenderPartial("BackToLogs"); }
<div>
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
</div>
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("Create", "Log", FormMethod.Post, new { @class = "form-horizontal" })) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Log</legend>
@Html.EditorForModel()
<p>
<input type="submit" value="Create" class="btn btn-primary" />
</p>
<div class="control-group">
<div class="controls">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</div>
</fieldset>
}
+2 -2
View File
@@ -4,9 +4,9 @@
ViewBag.Title = "Delete Log";
}
<h2>@ViewBag.Title</h2>
@{ Html.RenderPartial("BackToLogs"); }
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
<h2>@ViewBag.Title</h2>
<h3>Are you sure you wish to delete this log?</h3>
+4 -2
View File
@@ -4,9 +4,11 @@
ViewBag.Title = "Log Details";
}
@{ Html.RenderPartial("BackToLogs"); }
<h2>@ViewBag.Title</h2>
<div>
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
<div class="btn-toolbar">
@Html.ActionLink("Edit", "Edit", new { id = Model.LogId }, new { @class = "btn" })
@Html.ActionLink("Delete", "Delete", new { id = Model.LogId }, new { @class = "btn" })
</div>
+7 -8
View File
@@ -14,22 +14,21 @@
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
<h2>@ViewBag.Title</h2>
@{ Html.RenderPartial("BackToLogs"); }
<div>
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
</div>
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("Edit", "Log", FormMethod.Post, new { @class = "form-horizontal" }))
{
@Html.ValidationSummary(true)
<fieldset>
<legend>Log</legend>
@Html.EditorForModel()
<p>
<input type="submit" value="Save" />
</p>
<div class="control-group">
<div class="controls">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</div>
</fieldset>
}
+10 -10
View File
@@ -10,17 +10,17 @@
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToLogs"); }
<h2>@ViewBag.Title</h2>
<p class="no-print btn-group">
@Html.ActionLink("Logs", "Index", "Log", Model.Query, new { @class = "btn" })
</p>
@Html.DisplayFor(m => m.Query.Year)
@Html.DisplayFor(m => m.Query.Month)
@if (Model.Query.LogType.HasValue)
{
@Html.DisplayFor(m => m.Query.LogType)
}
@Html.DisplayFor(m => m.Query.Year)
@Html.DisplayFor(m => m.Query.Month)
@if (Model.Query.LogType.HasValue)
{
@Html.DisplayFor(m => m.Query.LogType)
}
<table class="table">
<tr>
<th>
@@ -48,7 +48,7 @@
<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>
<span class="report-miles">@Html.DisplayTextFor(i => item.Miles)</span>
@Html.Partial("LogsSummary", item.LogPairs)
</td>
<td>
+9 -10
View File
@@ -11,17 +11,16 @@
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
@{ Html.RenderPartial("BackToLogs"); }
<h2>@ViewBag.Title</h2>
<p class="no-print btn-group">
@Html.ActionLink("Logs", "Index", "Log", Model.Query, new { @class = "btn" })
</p>
@Html.DisplayFor(m => m.Query.Year)
@Html.DisplayFor(m => m.Query.Month)
@if (Model.Query.LogType.HasValue)
{
@Html.DisplayFor(m => m.Query.LogType)
}
@Html.DisplayFor(m => m.Query.Year)
@Html.DisplayFor(m => m.Query.Month)
@if (Model.Query.LogType.HasValue)
{
@Html.DisplayFor(m => m.Query.LogType)
}
<table class="table">
<tr>
<th>
@@ -49,7 +48,7 @@
<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>
<span class="report-miles">@Html.DisplayTextFor(i => item.Miles) </span>
@Html.Partial("LogsSummary", item.LogPairs)
</td>
<td>
+1 -1
View File
@@ -20,7 +20,7 @@
</div>
</div>
</header>
<div id="content">
<div class="container-fluid">
@RenderBody()
</div>
<footer>
+1 -1
View File
@@ -19,7 +19,7 @@
</div>
</header>
<div id="content">
<div class="container-fluid">
@RenderBody()
</div>
+5
View File
@@ -0,0 +1,5 @@
<ul class="no-print breadcrumb">
<li>
<a href="@Url.Action("Index", "Vehicle")">&larr; Back to Vehicles</a>
</li>
</ul>
+7 -6
View File
@@ -14,19 +14,20 @@
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
<h2>@ViewBag.Title</h2>
@{ Html.RenderPartial("BackToVehicles"); }
<div class="btn-toolbar">
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
</div>
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("Create", "Vehicle", FormMethod.Post, new { @class = "form-horizontal" }))
{
@Html.ValidationSummary(true)
<fieldset>
<legend>Vehicle</legend>
@Html.EditorForModel()
<input type="submit" value="Create" class="btn btn-primary" />
<div class="control-group">
<div class="controls">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
</div>
</fieldset>
}
+2 -1
View File
@@ -8,10 +8,11 @@
<link href="@Url.Content("~/Content/VehicleColors.css")" rel="stylesheet" type="text/css" />
}
@{ Html.RenderPartial("BackToVehicles"); }
<h2>@ViewBag.Title</h2>
<div class="btn-toolbar">
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
@Html.ActionLink("Edit", "Edit", new { id = Model.VehicleId }, new { @class = "btn" })
</div>
+8 -7
View File
@@ -14,19 +14,20 @@
<script src="@Url.Content("~/Scripts/jquery.qtip.min.js")" type="text/javascript"></script>
}
<h2>@ViewBag.Title</h2>
@{ Html.RenderPartial("BackToVehicles"); }
<div class="btn-toolbar">
@Html.ActionLink("Back to List", "Index", null, new { @class = "btn" })
</div>
<h2>@ViewBag.Title</h2>
@using (Html.BeginForm("Edit", "Vehicle", FormMethod.Post, new { @class = "form-horizontal" }))
{
@Html.ValidationSummary(true)
<fieldset>
<legend>Vehicle</legend>
@Html.EditorForModel()
<input type="submit" value="Save" class="btn btn-primary" />
<div class="control-group">
<div class="controls">
<input type="submit" value="Save" class="btn btn-primary" />
</div>
</div>
</fieldset>
}
+2 -3
View File
@@ -102,7 +102,6 @@
<Compile Include="ViewModels\VehiclePartialDetails.cs" />
<Compile Include="ViewModels\VehicleMileageItem.cs" />
<Compile Include="Utility\FormatHintAttribute.cs" />
<Compile Include="Utility\RequireRequestValueAttribute.cs" />
<Compile Include="DAL\ChronologicalOrderException.cs" />
<Compile Include="DAL\DataService.cs" />
<Compile Include="Controllers\HomeController.cs" />
@@ -137,14 +136,12 @@
<Content Include="Content\bootstrap-responsive.min.css" />
<Content Include="Content\bootstrap.css" />
<Content Include="Content\bootstrap.min.css" />
<Content Include="Content\images\Background.png" />
<Content Include="Content\CreateLog.Index.css" />
<Content Include="Content\images\glyphicons-halflings-white.png" />
<Content Include="Content\images\glyphicons-halflings.png" />
<Content Include="Content\images\glyphicons_005_car.png" />
<Content Include="Content\images\glyphicons_026_road.png" />
<Content Include="Content\images\Header.png" />
<Content Include="Content\images\Header_white.png" />
<Content Include="Content\jquery.qtip.min.css" />
<Content Include="Content\images\Rainbow.png" />
<None Include="Content\Site.admin.css.old" />
@@ -204,6 +201,8 @@
<Content Include="Views\Shared\Error.cshtml" />
<Content Include="Views\Shared\_Layout.admin.cshtml" />
<Content Include="Views\Web.config" />
<Content Include="Views\Log\BackToLogs.cshtml" />
<Content Include="Views\Vehicle\BackToVehicles.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />