Files
MileageTraker/Web/Views/User/Details.cshtml
T
poprhythm b19b44305a Add details to emails
A few clarifications
2013-01-15 15:28:17 -05:00

146 lines
4.3 KiB
Plaintext

@using MileageTraker.Web.Utility
@model MileageTraker.Web.Models.User
@{
ViewBag.Title = "User Details";
}
@{ Html.RenderPartial("BackToUsers"); }
@Html.Partial("_StatusMessage")
<h2 class="center-content">@ViewBag.Title</h2>
<div class="center-content well">
@Html.DisplayFor(m => m.FullName)
<dl class="dl-horizontal username">
<dt>
@Html.DisplayNameFor(m => m.Username)
</dt>
<dd>
@Html.Encode(Model.Username)
@Html.Partial("_UserStatusLabels")
</dd>
</dl>
@Html.DisplayFor(m => m.Email)
<dl class="dl-horizontal roles">
<dt>
@Html.DisplayNameFor(m => m.Roles)
</dt>
<dd>
@{ var roles = Roles.Provider.GetRolesForUser(Model.Username); }
@if (roles.Length > 0)
{
@Html.Encode(string.Join(", ", roles))
}
else
{
<span class='label label-warning'>No Role</span>
}
</dd>
</dl>
<dl class="dl-horizontal lastActivityDate">
<dt>
@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>
}
</dd>
</dl>
<dl class="dl-horizontal lastLoginDate">
<dt>
@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>
}
</dd>
</dl>
<dl class="dl-horizontal lastPasswordChangedDate">
<dt>
@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>
}
</dd>
</dl>
@if (Model.IsLockedOut) {
<dl class="dl-horizontal lastLockoutDate">
<dt>
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>
}
</dd>
</dl>
}
</div>
<div class="btn-toolbar center-content">
@Html.ActionLink("Edit", "Edit", new { id = Model.UserId }, new { @class = "btn" })
<div class="btn-group">
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
Password <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
@Html.ActionLink("Send Password Reset Email", "SendResetPassword", new { userId = Model.UserId })
</li>
<li>
@Html.ActionLink("Set Password", "SetPassword", new { id = Model.UserId })
</li>
</ul>
</div>
@if (Model.IsApproved)
{
@Html.ActionLink("Disable Account", "DisableUser", new {id = Model.UserId}, new {@class = "btn"})
}
else
{
@Html.ActionLink("Enable Account", "EnableUser", new {id = Model.UserId}, new {@class = "btn"})
}
@if (Model.IsLockedOut)
{
@Html.ActionLink("Unlock", "UnlockUser", new {id = Model.UserId}, new {@class = "btn"})
}
</div>