Refactoring

This commit is contained in:
2013-01-17 20:14:04 -05:00
parent dccadd3d42
commit ffb6961fe0
7 changed files with 26 additions and 54 deletions
+9 -38
View File
@@ -1,5 +1,4 @@
@using MileageTraker.Web.Utility
@model MileageTraker.Web.Models.User
@model MileageTraker.Web.Models.User
@{
ViewBag.Title = "User Details";
@@ -49,15 +48,8 @@
@Html.DisplayNameFor(m => m.LastActivityDate)
</dt>
<dd>
@if (!Model.LastActivityDate.IsSqlMinValue())
{
@Html.Encode(Model.LastActivityDate)
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastActivityDate).ToVerboseStringHistoric()))</span>
}
else
{
<span class='label label-info'>No Activity</span>
}
@Html.Partial("_DateTimeHistoric",
new Tuple<DateTime,string>(Model.LastActivityDate, "No Activity"))
</dd>
</dl>
@@ -66,15 +58,8 @@
@Html.DisplayNameFor(m => m.LastLoginDate)
</dt>
<dd>
@if (!Model.LastLoginDate.IsSqlMinValue())
{
@Html.Encode(Model.LastLoginDate)
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastLoginDate).ToVerboseStringHistoric()))</span>
}
else
{
<span class='label label-info'>Never Logged In</span>
}
@Html.Partial("_DateTimeHistoric",
new Tuple<DateTime,string>(Model.LastLoginDate, "Never Logged In"))
</dd>
</dl>
@@ -83,15 +68,8 @@
@Html.DisplayNameFor(m => m.LastPasswordChangedDate)
</dt>
<dd>
@if (!Model.LastPasswordChangedDate.IsSqlMinValue())
{
@Html.Encode(Model.LastPasswordChangedDate)
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastPasswordChangedDate).ToVerboseStringHistoric()))</span>
}
else
{
<span class='label label-info'>Never Changed</span>
}
@Html.Partial("_DateTimeHistoric",
new Tuple<DateTime,string>(Model.LastPasswordChangedDate, "Never Changed"))
</dd>
</dl>
@@ -101,15 +79,8 @@
Lockout Password Date
</dt>
<dd>
@if (!Model.LastLockoutDate.IsSqlMinValue())
{
@Html.Encode(Model.LastLockoutDate)
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastLockoutDate).ToVerboseStringHistoric()))</span>
}
else
{
<span class='label label-info'>Never Locked (?)</span>
}
@Html.Partial("_DateTimeHistoric",
new Tuple<DateTime,string>(Model.LastLockoutDate, "Never Locked (?)"))
</dd>
</dl>
}