Refactoring
This commit is contained in:
@@ -6,6 +6,7 @@ namespace MileageTraker.Web.ViewModels.Account
|
|||||||
public class LoginViewModel
|
public class LoginViewModel
|
||||||
{
|
{
|
||||||
[Required]
|
[Required]
|
||||||
|
[RegularExpression("[^@]*", ErrorMessage = "Enter just your username, not your email")]
|
||||||
public string Username { get; set; }
|
public string Username { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
@using MileageTraker.Web.Utility
|
@model MileageTraker.Web.Models.User
|
||||||
@model MileageTraker.Web.Models.User
|
|
||||||
|
|
||||||
@{
|
@{
|
||||||
ViewBag.Title = "User Details";
|
ViewBag.Title = "User Details";
|
||||||
@@ -49,15 +48,8 @@
|
|||||||
@Html.DisplayNameFor(m => m.LastActivityDate)
|
@Html.DisplayNameFor(m => m.LastActivityDate)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@if (!Model.LastActivityDate.IsSqlMinValue())
|
@Html.Partial("_DateTimeHistoric",
|
||||||
{
|
new Tuple<DateTime,string>(Model.LastActivityDate, "No Activity"))
|
||||||
@Html.Encode(Model.LastActivityDate)
|
|
||||||
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastActivityDate).ToVerboseStringHistoric()))</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<span class='label label-info'>No Activity</span>
|
|
||||||
}
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
@@ -66,15 +58,8 @@
|
|||||||
@Html.DisplayNameFor(m => m.LastLoginDate)
|
@Html.DisplayNameFor(m => m.LastLoginDate)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@if (!Model.LastLoginDate.IsSqlMinValue())
|
@Html.Partial("_DateTimeHistoric",
|
||||||
{
|
new Tuple<DateTime,string>(Model.LastLoginDate, "Never Logged In"))
|
||||||
@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>
|
|
||||||
}
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
@@ -83,15 +68,8 @@
|
|||||||
@Html.DisplayNameFor(m => m.LastPasswordChangedDate)
|
@Html.DisplayNameFor(m => m.LastPasswordChangedDate)
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@if (!Model.LastPasswordChangedDate.IsSqlMinValue())
|
@Html.Partial("_DateTimeHistoric",
|
||||||
{
|
new Tuple<DateTime,string>(Model.LastPasswordChangedDate, "Never Changed"))
|
||||||
@Html.Encode(Model.LastPasswordChangedDate)
|
|
||||||
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastPasswordChangedDate).ToVerboseStringHistoric()))</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<span class='label label-info'>Never Changed</span>
|
|
||||||
}
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
@@ -101,15 +79,8 @@
|
|||||||
Lockout Password Date
|
Lockout Password Date
|
||||||
</dt>
|
</dt>
|
||||||
<dd>
|
<dd>
|
||||||
@if (!Model.LastLockoutDate.IsSqlMinValue())
|
@Html.Partial("_DateTimeHistoric",
|
||||||
{
|
new Tuple<DateTime,string>(Model.LastLockoutDate, "Never Locked (?)"))
|
||||||
@Html.Encode(Model.LastLockoutDate)
|
|
||||||
<span class="muted">(@Html.Encode((DateTime.Now - Model.LastLockoutDate).ToVerboseStringHistoric()))</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<span class='label label-info'>Never Locked (?)</span>
|
|
||||||
}
|
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
</text>),
|
</text>),
|
||||||
grid.Column("LastActivityDate", "Last Activity",
|
grid.Column("LastActivityDate", "Last Activity",
|
||||||
@<text>
|
@<text>
|
||||||
@Html.Partial("_LastActivity", (DateTime)item.LastActivityDate)
|
@Html.Partial("_DateTimeHistoric", new Tuple<DateTime,string>((DateTime)item.LastActivityDate, "No Activity"))
|
||||||
</text>),
|
</text>),
|
||||||
grid.Column(format:
|
grid.Column(format:
|
||||||
@<div class='btn-group'>
|
@<div class='btn-group'>
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
@using MileageTraker.Web.Utility
|
||||||
|
@model Tuple<DateTime,string>
|
||||||
|
|
||||||
|
@if (!Model.Item1.IsSqlMinValue())
|
||||||
|
{
|
||||||
|
@Html.Encode((DateTime.Now - Model.Item1).ToVerboseStringHistoric())
|
||||||
|
<span class="muted">(@Html.Encode(Model.Item1))</span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<span class='label label-info'>@Model.Item2</span>
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
@using MileageTraker.Web.Utility
|
|
||||||
@model DateTime
|
|
||||||
|
|
||||||
@if (!Model.IsSqlMinValue())
|
|
||||||
{
|
|
||||||
@Html.Encode(Model)
|
|
||||||
<span class="muted">(@Html.Encode((DateTime.Now - Model).ToVerboseStringHistoric()))</span>
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
<span class='label label-info'>No Activity</span>
|
|
||||||
}
|
|
||||||
+2
-2
@@ -14,8 +14,8 @@
|
|||||||
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
|
||||||
<add key="enableSimpleMembership" value="false" />
|
<add key="enableSimpleMembership" value="false" />
|
||||||
<add key="EmailFromAddress" value="Mileage Traker <noreply@ethra.org>" />
|
<add key="EmailFromAddress" value="Mileage Traker <noreply@ethra.org>" />
|
||||||
<add key="ResetPasswordSubject" value="New Password Request" />
|
<add key="ResetPasswordSubject" value="New Mileage Traker Password Request" />
|
||||||
<add key="ResetPasswordBody" value="{1}, please open this link to set a new password for your Mileage Traker account: {0}" />
|
<add key="ResetPasswordBody" value="Hello {1}, please open this link to set a new password for your Mileage Traker account: {0}" />
|
||||||
<add key="InitializePasswordSubject" value="Initialize Mileage Traker Account" />
|
<add key="InitializePasswordSubject" value="Initialize Mileage Traker Account" />
|
||||||
<add key="InitializetPasswordBody" value="Hello {1}, welcome to Mileage Traker. Your username is {2}. Please open this link to initialize your password: {0}" />
|
<add key="InitializetPasswordBody" value="Hello {1}, welcome to Mileage Traker. Your username is {2}. Please open this link to initialize your password: {0}" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
|
|||||||
+1
-1
@@ -300,9 +300,9 @@
|
|||||||
<Content Include="Views\User\_UserStatusLabels.cshtml" />
|
<Content Include="Views\User\_UserStatusLabels.cshtml" />
|
||||||
<Content Include="Views\Account\ResetPassword.cshtml" />
|
<Content Include="Views\Account\ResetPassword.cshtml" />
|
||||||
<Content Include="Views\Account\NewPassword.cshtml" />
|
<Content Include="Views\Account\NewPassword.cshtml" />
|
||||||
<Content Include="Views\User\_LastActivity.cshtml" />
|
|
||||||
<Content Include="Views\Shared\EditorTemplates\CheckBoxViewModel.cshtml" />
|
<Content Include="Views\Shared\EditorTemplates\CheckBoxViewModel.cshtml" />
|
||||||
<Content Include="Views\User\InviteUninitialized.cshtml" />
|
<Content Include="Views\User\InviteUninitialized.cshtml" />
|
||||||
|
<Content Include="Views\User\_DateTimeHistoric.cshtml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="packages.config">
|
<Content Include="packages.config">
|
||||||
|
|||||||
Reference in New Issue
Block a user