Nearing feature complete for driver auth

This commit is contained in:
2013-01-09 21:33:57 -05:00
parent 0b4c7914b3
commit bc019923d2
49 changed files with 609 additions and 335 deletions
+2 -2
View File
@@ -65,7 +65,8 @@
@Html.HiddenFor(model => model.LogType.Value)
@Html.DisplayFor(model => model.CityName)
@Html.HiddenFor(model => model.CityName)
@* // Html.HiddenFor(model => model.CityName) is losing capitalization *@
<input type="hidden" name="CityName" value="@Model.CityName"/>
<dl class="dl-horizontal gas">
<dt>
@@ -84,7 +85,6 @@
</dl>
@Html.HiddenFor(model => model.GasPurchased)
<dl class="dl-horizontal date">
<dt>
@Html.DisplayNameFor(m => m.Date)
+4
View File
@@ -19,3 +19,7 @@
</div>
</fieldset>
}
<div id="RecentLogs" class="center-content well">
</div>
+2 -9
View File
@@ -4,7 +4,7 @@
@if (Model.Any())
{
<h5>Recent Logs for @ViewData["employeeName"]</h5>
<h5>Recent Logs for @ViewData["name"]</h5>
<table class="table">
<thead>
<tr>
@@ -43,12 +43,5 @@
}
else
{
if (!string.IsNullOrEmpty(ViewData["employeeName"].ToString()))
{
<h5>Mileage history not found for employee "@ViewData["employeeName"]"</h5>
}
else
{
<h5>Please enter employee name</h5>
}
<p>Mileage history not found for <strong>@ViewData["name"]</strong></p>
}
+1 -1
View File
@@ -1,4 +1,4 @@
@model MileageTraker.Web.Models.Log
@model MileageTraker.Web.ViewModels.Log.LogViewModel
@{
ViewBag.Title = "Create Log";
+1 -1
View File
@@ -1,4 +1,4 @@
@model MileageTraker.Web.Models.Log
@model MileageTraker.Web.ViewModels.Log.LogViewModel
@{
ViewBag.Title = "Delete Log";
+1 -1
View File
@@ -1,4 +1,4 @@
@model MileageTraker.Web.Models.Log
@model MileageTraker.Web.ViewModels.Log.LogViewModel
@{
ViewBag.Title = "Log Details";
+1 -1
View File
@@ -1,4 +1,4 @@
@model MileageTraker.Web.Models.Log
@model MileageTraker.Web.ViewModels.Log.LogViewModel
@{
ViewBag.Title = "Edit Log";
+1 -1
View File
@@ -56,7 +56,7 @@
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", item => item.User != null ? item.User.FullName : ""),
grid.Column("Driver Name", format: item => item.User != null ? item.User.FullName : ""),
grid.Column(format:
@<div class='btn-group'>
@Html.ActionLink("Edit", "Edit", new { id = item.LogId }, new { @class = "btn btn-mini" })
@@ -0,0 +1,11 @@
@model MileageTraker.Web.ViewModels.CheckBoxViewModel
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
ViewData.ModelMetadata.DisplayName = "Roles";
}
@Html.CheckBoxListFor(
m => m.Selected,
m => m.Available,
m => m,
m => m,
m => m.Selected)
@@ -11,9 +11,5 @@
{
@Html.Editor(prop.PropertyName)
}
else
{
}
}
}
+6 -4
View File
@@ -23,14 +23,16 @@
<span class="brand"></span>
<div class="nav-collapse collapse">
<ul class="nav">
@if (Roles.IsUserInRole(User.Identity.Name, "Administrator")
|| Roles.IsUserInRole(User.Identity.Name, "Developer"))
@if (User.IsInRole("Driver") || User.IsInRole("Developer") || User.IsInRole("Administrator"))
{
<li>@Html.ActionLink("Enter Log", "Index", "CreateLog")</li>
}
@if (User.IsInRole("Developer") || User.IsInRole("Administrator"))
{
<li id="log-nav">@Html.ActionLink("Logs", "Index", "Log")</li>
<li id="vehicle-nav">@Html.ActionLink("Vehicles", "Index", "Vehicle")</li>
<li id="user-nav">@Html.ActionLink("Users", "Index", "User")</li>
}
<li>@Html.ActionLink("Enter Log", "Index", "CreateLog")</li>
}
</ul>
<section id="account-management">
@Html.Partial("_NavAccountInfo")
+1 -2
View File
@@ -8,13 +8,12 @@
<h2 class="center-content">@ViewBag.Title</h2>
@using (Html.BeginForm("Create", "User", FormMethod.Post, new { @class = "form-horizontal well center-content" }))
@using (Html.BeginForm("Create", "User", FormMethod.Post, new { @class = "form-horizontal well center-content create-user" }))
{
@Html.Partial("_ValidationSummary")
<fieldset>
<legend></legend>
@Html.EditorForModel()
@Html.Partial("_Roles", Model)
<div class="form-actions">
<input type="submit" value="Create" class="btn btn-primary" />
</div>
+2 -2
View File
@@ -13,6 +13,8 @@
<div class="center-content well">
@Html.DisplayFor(m => m.FullName)
<dl class="dl-horizontal username">
<dt>
@Html.DisplayNameFor(m => m.Username)
@@ -25,8 +27,6 @@
@Html.DisplayFor(m => m.Email)
@Html.DisplayFor(m => m.FullName)
<dl class="dl-horizontal roles">
<dt>
@Html.DisplayNameFor(m => m.Roles)
-1
View File
@@ -18,7 +18,6 @@
<legend></legend>
@Html.EditorForModel()
@Html.Partial("_Roles", Model)
<div class="form-actions">
<input type="submit" value="Save" class="btn btn-primary" />
+4 -4
View File
@@ -25,7 +25,8 @@
@grid.GetHtml(columns:
grid.Columns(
grid.Column("Username", format:
grid.Column("FullName", "Full Name"),
grid.Column("Username", format:
@<text>
<span title="@Html.Encode(item.Email)">
@Html.Encode(item.Username)
@@ -37,7 +38,6 @@
LastLockoutDate = item.LastLockoutDate,
IsApproved = item.IsApproved})
</text> ),
grid.Column("FullName", "Full Name"),
grid.Column("Roles", format:
@<text>
@{var roles = Roles.Provider.GetRolesForUser(item.Username);}
@@ -50,10 +50,10 @@
<span class='label label-warning'>No Role</span>
}
</text>),
grid.Column("LastActivityDate", "Last Activity", format:
grid.Column("LastActivityDate", "Last Activity",
@<text>
@Html.Partial("_LastActivity", (DateTime)item.LastActivityDate)
</text>),
</text>),
grid.Column(format:
@<div class='btn-group'>
@*Html.ActionLink("Edit", "Edit", new { id = item.UserId }, new { @class = "btn btn-mini" })*@
-10
View File
@@ -1,10 +0,0 @@
@model MileageTraker.Web.ViewModels.User.RolesViewModel
@{
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
}
@Html.CheckBoxListFor(
m => m.Roles,
m => m.AvailableRoles,
m => m,
m => m,
m => m.Roles)