diff --git a/app/assets/javascripts/application.js.erb b/app/assets/javascripts/application.js.erb index 0f3dd89572..12670b0654 100644 --- a/app/assets/javascripts/application.js.erb +++ b/app/assets/javascripts/application.js.erb @@ -63,7 +63,6 @@ //= require search //= require colors //= require tooltips -//= require change_password //source: http://stackoverflow.com/questions/8120065/jquery-and-prototype-dont-work-together-with-array-prototype-reverse if (typeof []._reverse == 'undefined') { diff --git a/app/assets/javascripts/change_password.js b/app/assets/javascripts/change_password.js deleted file mode 100644 index 381091c0b4..0000000000 --- a/app/assets/javascripts/change_password.js +++ /dev/null @@ -1,16 +0,0 @@ -jQuery(function($) { - $('#new_password_confirmation, #new_password, #password').keyup(function() { - var passwordPresent = $('#password').val().length > 0; - var button = $('input[name="commit"]'); - var newPass = $('#new_password').val(); - var newPassConfirm = $('#new_password_confirmation').val(); - var newPasswordsMatches = newPass === newPassConfirm; - var newPasswordsPresent = (newPass.length > 0) && (newPassConfirm.length > 0); - - if (passwordPresent && newPasswordsMatches && newPasswordsPresent) { - button.removeAttr('disabled'); - } else { - button.attr('disabled','disabled'); - } - }); -}); diff --git a/app/helpers/password_helper.rb b/app/helpers/password_helper.rb index dca346662d..9653337699 100644 --- a/app/helpers/password_helper.rb +++ b/app/helpers/password_helper.rb @@ -31,10 +31,10 @@ module PasswordHelper def render_password_complexity_tooltip rules = password_rules_description - s = content_tag(:p, OpenProject::Passwords::Evaluator.min_length_description) - s += rules.capitalize.html_safe if rules.present? + s = OpenProject::Passwords::Evaluator.min_length_description + s += "
#{rules}" if rules.present? - s + s.html_safe end private diff --git a/app/views/my/_password_form_fields.html.erb b/app/views/my/_password_form_fields.html.erb index 0725b5827c..d067dd7f22 100644 --- a/app/views/my/_password_form_fields.html.erb +++ b/app/views/my/_password_form_fields.html.erb @@ -11,19 +11,19 @@
- <%= styled_label_tag 'password', User.human_attribute_name(:password) %> + <%= styled_label_tag 'password', User.human_attribute_name(:password), class: '-required' %>
- <%= styled_password_field_tag 'password', nil, :size => 25 %> + <%= styled_password_field_tag 'password', nil, :size => 25, required: true %>
-
- <%= styled_label_tag 'new_password', User.human_attribute_name(:new_password) %> +
+ <%= styled_label_tag 'new_password', User.human_attribute_name(:new_password), class: '-required' %>
<%= styled_password_field_tag 'new_password', nil, :size => 25, - 'aria-describedby' => 'new_password_tooltip', + 'aria-describedby' => 'new_password_tooltip', required: true, class: 'advanced-tooltip-trigger'%>
@@ -35,9 +35,9 @@
<%= styled_label_tag 'new_password_confirmation', - User.human_attribute_name(:password_confirmation) %> + User.human_attribute_name(:password_confirmation), class: '-required' %>
- <%= styled_password_field_tag 'new_password_confirmation', nil, + <%= styled_password_field_tag 'new_password_confirmation', nil, required: true, 'aria-describedby' => 'confirm_password_tooltip', :size => 25, class: 'advanced-tooltip-trigger' %>
diff --git a/app/views/my/password.html.erb b/app/views/my/password.html.erb index 41c4f1d06f..ebd67b00e9 100644 --- a/app/views/my/password.html.erb +++ b/app/views/my/password.html.erb @@ -30,8 +30,8 @@ See doc/COPYRIGHT.rdoc for more details. <%= toolbar title: l(:button_change_password) %> <%= error_messages_for 'user' %> -<%= styled_form_tag({:action => :change_password}, - {:autocomplete => 'off', class: 'form -wide-labels'}) do %> +<%= styled_form_tag({ action: :change_password }, + { autocomplete: 'off', class: 'form -wide-labels' }) do %> <%= back_url_hidden_field_tag %>
diff --git a/config/locales/en.yml b/config/locales/en.yml index bef9199c06..4c9f74be7c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -249,7 +249,7 @@ en: user: attributes: password: - weak: "must contain characters of the following classes (at least %{min_count} of %{all_count}): %{rules}" + weak: "Must contain characters of the following classes (at least %{min_count} of %{all_count}): %{rules}" lowercase: "lowercase (e.g. 'a')" uppercase: "uppercase (e.g. 'A')" numeric: "numeric (e.g. '1')" @@ -259,7 +259,7 @@ en: other: "has been used before. Please choose one that is different from your last %{count}." match: confirm: "Confirm new password." - description: "Password should match with the one you have typed in New password field." + description: "'Password confirmation' should match the input in the 'New password' field." member: principal_blank: "Please choose at least one user or group." role_blank: "Please choose at least one role."