diff --git a/app/assets/javascripts/sitewide/form_errors.js b/app/assets/javascripts/sitewide/form_errors.js index 789ce42bc..d7be9bb5b 100644 --- a/app/assets/javascripts/sitewide/form_errors.js +++ b/app/assets/javascripts/sitewide/form_errors.js @@ -16,6 +16,7 @@ * error that can happen/show. */ var renderFormError = function(ev, input, errMsgs, clearErr, errAttributes) { + // console.log(input) clearErr = _.isUndefined(clearErr) ? false : clearErr; errAttributes = _.isUndefined(errAttributes) ? '' : ' ' + errAttributes; var $form = $(input).closest('form'); @@ -37,9 +38,11 @@ var renderFormError = function(ev, input, errMsgs, clearErr, errAttributes) { // Mark error form group var $formGroup = $(input).closest('.form-group'); - if (!$formGroup.hasClass('has-error')) { - $formGroup.addClass('has-error'); - } + $formGroup.each(function() { + if (!$(this).hasClass('has-error')) { + $(this).addClass('has-error'); + } + }); var $errSpan = "' + errorText + '.' + ''; diff --git a/app/assets/stylesheets/shared_styles/elements/input_fields.scss b/app/assets/stylesheets/shared_styles/elements/input_fields.scss index 00c27c3ab..97277c2b4 100644 --- a/app/assets/stylesheets/shared_styles/elements/input_fields.scss +++ b/app/assets/stylesheets/shared_styles/elements/input_fields.scss @@ -53,6 +53,10 @@ } } + input.sci-input-field { + height: 36px !important; + } + .sn-icon { bottom: 6px; position: absolute; @@ -166,4 +170,44 @@ } } } + + &.password-input-container { + .password-icon-wrapper { + position: relative; + + input { + padding-right: 2.4em; + } + } + + .sn-icon { + align-items: center; + display: flex; + height: 100%; + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + width: 24px; + } + + .help-block { + left: 0; + position: absolute; + width: 100%; + + &:nth-of-type(2) { top: 60px; } + &:nth-of-type(3) { top: 120px; } + } + + &.error::before, + &.has-error { + padding-bottom: 0; + } + + &.has-error { + margin-bottom: inherit; + padding-bottom: 2em; + } + } } diff --git a/app/assets/stylesheets/sign_up.scss b/app/assets/stylesheets/sign_up.scss index 76783bff6..c48b89e6a 100644 --- a/app/assets/stylesheets/sign_up.scss +++ b/app/assets/stylesheets/sign_up.scss @@ -25,12 +25,8 @@ margin-bottom: 24px; } - .sci-input-container:not(.field_with_errors) { - margin-bottom: 24px; - - .minimum-password-length { - @include font-small; - } + .sci-input-container:not(.field_with_errors) .minimum-password-length { + @include font-small; } .sign-up-button { diff --git a/app/views/users/invitations/edit.html.erb b/app/views/users/invitations/edit.html.erb index 1a1214315..c58bb9bd8 100644 --- a/app/views/users/invitations/edit.html.erb +++ b/app/views/users/invitations/edit.html.erb @@ -8,26 +8,30 @@ <%= f.hidden_field :invitation_token %> -

+

<%= f.label :full_name %> <%= f.text_field :full_name, value: (params[:user] ? params[:user][:full_name] : ''), autofocus: true, class: 'sci-input-field' %> -

- -

+

+ +
<%= f.label :password %> <% if @minimum_password_length %> (<%= @minimum_password_length %> characters minimum) <% end %> - <%= f.password_field :password, autocomplete: "off", class: "sci-input-field" %> -

- -

+

+ <%= f.password_field :password, autocomplete: "off", class: "sci-input-field" %> +
+
+ +
<%= f.label :password_confirmation %> - <%= f.password_field :password_confirmation, autocomplete: "off", class: "sci-input-field" %> -

+
+ <%= f.password_field :password_confirmation, autocomplete: "off", class: "sci-input-field" %> +
+
<% if Rails.configuration.x.new_team_on_signup %>

<%= t("users.registrations.edit.2fa_modal.disable.description") %>

<%= label_tag :password, t("users.registrations.edit.2fa_modal.disable.password_label") %> -
- <%= password_field_tag :password, '', class: "sci-input-field" %> +
+
+ <%= password_field_tag :password, '', class: "sci-input-field" %> +
-
+
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <%=t "users.registrations.edit.password_explanation" %> - <%= f.password_field :current_password, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear", id: 'edit-email-current-password' %> +
+ <%= f.password_field :current_password, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear", id: 'edit-email-current-password' %> +
<%=t "general.cancel" %> diff --git a/app/views/users/registrations/edit_partials/_password.html.erb b/app/views/users/registrations/edit_partials/_password.html.erb index 074eb3723..b8f3734c2 100644 --- a/app/views/users/registrations/edit_partials/_password.html.erb +++ b/app/views/users/registrations/edit_partials/_password.html.erb @@ -16,19 +16,25 @@

<%=t "users.registrations.edit.password_title" %>

-
+
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <%=t "users.registrations.edit.password_explanation" %> - <%= f.password_field :current_password, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear", id: 'edit-password-current-password' %> +
+ <%= f.password_field :current_password, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear", id: 'edit-password-current-password' %> +
-
- <%= f.label :password, t("users.registrations.edit.new_password_label") %> +
+ <%= f.label :password, t("users.registrations.edit.new_password_label") %> +
<%= f.password_field :password, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear" %> +
-
+
<%= f.label :password_confirmation, t("users.registrations.edit.new_password_2_label") %> - <%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear" %> +
+ <%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear" %> +
diff --git a/app/views/users/registrations/new.html.erb b/app/views/users/registrations/new.html.erb index 9e9ca0d1e..b7767fe43 100644 --- a/app/views/users/registrations/new.html.erb +++ b/app/views/users/registrations/new.html.erb @@ -25,17 +25,21 @@ <%= f.email_field :email, class: 'form-control sci-input-field' %>
-
+
<%= f.label :password, t('users.registrations.new.password_label') %> <% if @minimum_password_length %> <%= t('users.registrations.new.minimum_password_length', password_length: @minimum_password_length) %> <% end %> - <%= f.password_field :password, autocomplete: 'off', class: 'form-control sci-input-field' %> +
+ <%= f.password_field :password, autocomplete: 'off', class: 'form-control sci-input-field' %> +
-
+
<%= f.label :password_confirmation, t('users.registrations.new.password_confirmation_label') %> - <%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control sci-input-field' %> +
+ <%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control sci-input-field' %> +
<% if Rails.configuration.x.new_team_on_signup %>