password reset feedback fixes

This commit is contained in:
vfedosevich 2015-04-29 05:44:09 -07:00
parent afae6c4a6d
commit dde62638b2
18 changed files with 228 additions and 23 deletions

View file

@ -1,9 +1,9 @@
@{
@using WebsitePanel.WebDavPortal.Resources
@using WebsitePanel.WebDavPortal.UI.Routes
@model WebsitePanel.WebDavPortal.Models.Account.PasswordResetFinalStepModel
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using WebsitePanel.WebDavPortal.Resources
@using WebsitePanel.WebDavPortal.UI.Routes
@model WebsitePanel.WebDavPortal.Models.Common.EditorTemplates.PasswordEditor
<div class="container row">
@using (Html.BeginRouteForm(AccountRouteNames.PasswordResetFinalStep, FormMethod.Post, new { @class = "form-horizontal user-password-reset-final-step bs-val-styles col-lg-9 col-lg-offset-3", id = "user-password-reset" }))
@ -12,8 +12,14 @@
<div class="form-group">
<h3>@UI.PasswordReset</h3>
</div>
<div class="form-group">
<span>
@string.Format(UI.YouRChangingPswForFormat, Model.Login)
</span>
</div>
@Html.EditorFor(x=>x)
@Html.EditorFor(x => x.PasswordEditor)
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
@ -23,5 +29,64 @@
}
</div>
@if (Model.PasswordEditor.Settings != null)
{
<div class="form-group hidden" id="password-hint-popup">
<ul>
<li>
@string.Format(Messages.PasswordMinLengthFormat, Model.PasswordEditor.Settings.MinimumLength)
</li>
<li>
@string.Format(Messages.PasswordMaxLengthFormat, Model.PasswordEditor.Settings.MaximumLength)
</li>
@if (Model.PasswordEditor.Settings.PasswordComplexityEnabled)
{
if (Model.PasswordEditor.Settings.UppercaseLettersCount > 0)
{
<li>
@string.Format(Messages.PasswordUppercaseCountFormat, Model.PasswordEditor.Settings.UppercaseLettersCount)
</li>
}
if (Model.PasswordEditor.Settings.NumbersCount > 0)
{
<li>
@string.Format(Messages.PasswordNumbersCountFormat, Model.PasswordEditor.Settings.NumbersCount)
</li>
}
if (Model.PasswordEditor.Settings.SymbolsCount > 0)
{
<li>
@string.Format(Messages.PasswordSymbolsCountFormat, Model.PasswordEditor.Settings.SymbolsCount)
</li>
}
}
</ul>
</div>
}
@section scripts{
<script>
$(function() {
if ($(document).width() < 800) {
$('.password-input').data('placement', "bottom");
}
$(".password-input").popover({
html: true,
title: '@UI.PasswordFollowingRequirements',
content: function() {
return $('#password-hint-popup').html();
}
})
.blur(function() {
$(this).popover('hide');
});
});
</script>
}

View file

@ -8,7 +8,7 @@
<div class="form-group">
<label for="@Html.IdFor(x => x.NewPassword)" class="col-sm-2 control-label">@UI.NewPassword</label>
<div class="col-sm-10">
@Html.PasswordFor(x => x.NewPassword, new { @class = "form-control", placeholder = UI.NewPassword, maxlength })
@Html.PasswordFor(x => x.NewPassword, new { @class = "form-control password-input", placeholder = UI.NewPassword, maxlength })
@Html.Raw(HttpUtility.HtmlDecode(Html.ValidationMessageFor(m => m.NewPassword).ToHtmlString()))
</div>
</div>
@ -16,7 +16,7 @@
<div class="form-group">
<label for="@Html.IdFor(x => x.NewPasswordConfirmation)" class="col-sm-2 control-label">@UI.NewPasswordConfirmation</label>
<div class="col-sm-10">
@Html.PasswordFor(x => x.NewPasswordConfirmation, new { @class = "form-control", placeholder = UI.NewPasswordConfirmation, maxlength })
@Html.PasswordFor(x => x.NewPasswordConfirmation, new { @class = "form-control" , placeholder = UI.NewPasswordConfirmation, maxlength })
@Html.ValidationMessageFor(x => x.NewPasswordConfirmation)
</div>
</div>