Commit 91c96b37 authored by Patricio Cano's avatar Patricio Cano

Added a password strength indicator

to the reset password view and the change password view after first login.
Updated JS to work with the updated views.
parent 3d705131
...@@ -15,10 +15,10 @@ $(document).ready -> ...@@ -15,10 +15,10 @@ $(document).ready ->
profileOptions.rules = profileOptions.rules =
activated: overwritten_rules activated: overwritten_rules
signUpOptions = {} deviseOptions = {}
signUpOptions.common = deviseOptions.common =
usernameField: "#user_username" usernameField: "#user_username"
signUpOptions.ui = deviseOptions.ui =
container: "#password-strength" container: "#password-strength"
showPopover: true showPopover: true
showErrors: true showErrors: true
...@@ -26,8 +26,9 @@ $(document).ready -> ...@@ -26,8 +26,9 @@ $(document).ready ->
showProgressBar: false showProgressBar: false
showStatus: true showStatus: true
errorMessages: overwritten_messages errorMessages: overwritten_messages
signUpOptions.rules = deviseOptions.rules =
activated: overwritten_rules activated: overwritten_rules
$("#user_password").pwstrength profileOptions $("#user_password").pwstrength profileOptions
$("#user_password_sign_up").pwstrength signUpOptions $("#user_password_sign_up").pwstrength deviseOptions
$("#user_password_recover").pwstrength deviseOptions
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
.devise-errors .devise-errors
= devise_error_messages! = devise_error_messages!
= f.hidden_field :reset_password_token = f.hidden_field :reset_password_token
%div .form-group#password-strength
= f.password_field :password, class: "form-control top", placeholder: "New password", required: true = f.password_field :password, class: "form-control top", id: "user_password_recover", placeholder: "New password", required: true
%div %div
= f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true = f.password_field :password_confirmation, class: "form-control bottom", placeholder: "Confirm new password", required: true
.clearfix.append-bottom-10 .clearfix.append-bottom-10
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
.form-group .form-group
= f.label :current_password, class: 'control-label' = f.label :current_password, class: 'control-label'
.col-sm-10= f.password_field :current_password, required: true, class: 'form-control' .col-sm-10= f.password_field :current_password, required: true, class: 'form-control'
.form-group .form-group#password-strength
= f.label :password, class: 'control-label' = f.label :password, class: 'control-label'
.col-sm-10= f.password_field :password, required: true, class: 'form-control' .col-sm-10= f.password_field :password, required: true, class: 'form-control'
.form-group .form-group
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment