fixes errors with form id duplicates [fixes SCI-2039]

This commit is contained in:
zmagod 2018-02-09 14:54:16 +01:00
parent 128f15f984
commit ace78cfb58

View file

@ -18,8 +18,10 @@
<%= devise_error_messages! %>
</div>
<% end %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, "data-for" => "avatar" }) do |f| %>
<%= form_for(resource,
as: resource_name,
url: registration_path(resource_name),
html: { method: :put, "data-for" => "avatar", id: 'user-avatar-field' }) do |f| %>
<%= hidden_field_tag "user[change_avatar]", "true" %>
<div data-part="view">
<div class="form-group">
@ -54,12 +56,11 @@
</div>
</div>
<% end %>
<%= form_for(resource,
as: resource_name,
url: registration_path(resource_name, format: :json),
remote: true,
html: { method: :put, "data-for" => "full_name", class: 'settings-page-full-name' }) do |f| %>
html: { method: :put, "data-for" => "full_name", class: 'settings-page-full-name', id: 'user-full_name-field' }) do |f| %>
<div data-part="view">
<div class="form-group">
<%= f.label t("users.registrations.edit.name_label") %>
@ -90,7 +91,7 @@
as: resource_name,
url: registration_path(resource_name, format: :json),
remote: true,
html: { method: :put, "data-for" => "initials", class: 'settings-page-initials' }) do |f| %>
html: { method: :put, "data-for" => "initials", class: 'settings-page-initials', id: 'user-initials-field' }) do |f| %>
<div data-part="view">
<div class="form-group">
<%= f.label t("users.registrations.edit.initials_label") %>
@ -121,7 +122,7 @@
as: resource_name,
url: registration_path(resource_name, format: :json),
remote: true,
html: { method: :put, "data-for" => "email", class: 'settings-page-email' }) do |f| %>
html: { method: :put, "data-for" => "email", class: 'settings-page-email', id: 'user-email-field' }) do |f| %>
<div data-part="view">
<div class="form-group">
<%= f.label t("users.registrations.edit.email_label") %>
@ -148,7 +149,7 @@
</div>
<div class="form-group">
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <i><%=t "users.registrations.edit.password_explanation" %></i>
<%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
<%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear", id: 'edit-email-current-password' %>
</div>
<div>
<a href="#" class="btn btn-default" data-action="cancel"><%=t "general.cancel" %></a>
@ -162,7 +163,7 @@
as: resource_name,
url: registration_path(resource_name, format: :json),
remote: true,
html: { method: :put, "data-for" => "password", class: 'settings-page-change-password' }) do |f| %>
html: { method: :put, "data-for" => "password", class: 'settings-page-change-password', id: 'user-password-field' }) do |f| %>
<%= hidden_field_tag "user[change_password]", "true" %>
<div data-part="view">
<div class="form-group">
@ -180,7 +181,7 @@
<h4><%=t "users.registrations.edit.password_title" %></h4>
<div class="form-group">
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <i><%=t "users.registrations.edit.password_explanation" %></i>
<%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear" %>
<%= f.password_field :current_password, autocomplete: "off", class: "form-control", "data-role" => "clear", id: 'edit-password-current-password' %>
</div>
<div class="form-group">