diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 3fce5a9..fbaf6d7 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -82,7 +82,6 @@ @other_organisations = Org.where(parent_id: nil, is_other: true).pluck(:id) @identifier_schemes = IdentifierScheme.where(active: true).order(:name) @languages = Language.sorted_by_abbreviation - @tab = params[:tab] if params[:skip_personal_details] == "true" do_update_password(current_user, params) else @@ -156,7 +155,7 @@ set_gettext_locale #Method defined at controllers/application_controller.rb set_flash_message :notice, success_message(_('profile'), _('saved')) sign_in current_user, bypass: true # Sign in the user bypassing validation in case his password changed - redirect_to edit_user_registration_path(tab: @tab), notice: success_message(_('profile'), _('saved')) + redirect_to "#{edit_user_registration_path}\#personal-details", notice: success_message(_('profile'), _('saved')) else flash[:alert] = message.blank? ? failed_update_error(current_user, _('profile')) : message @@ -180,7 +179,7 @@ set_gettext_locale #Method defined at controllers/application_controller.rb set_flash_message :notice, success_message(_('password'), _('saved')) sign_in current_user, bypass: true # Sign in the user bypassing validation in case his password changed - redirect_to edit_user_registration_path(tab: @tab), notice: success_message(_('password'), _('saved')) + redirect_to "#{edit_user_registration_path}\#password-details", notice: success_message(_('password'), _('saved')) else flash[:alert] = message.blank? ? failed_update_error(current_user, _('profile')) : message diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1aa751c..6c5f88f 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -71,8 +71,8 @@ pref.settings[:email] = booleanize_hash(prefs) pref.save - @tab = params[:tab] - redirect_to edit_user_registration_path(tab: @tab), notice: success_message(_('preferences'), _('saved')) + # Include active tab in redirect path + redirect_to "#{edit_user_registration_path}\#notification-preferences", notice: success_message(_('preferences'), _('saved')) end private diff --git a/app/views/devise/registrations/_password_details.html.erb b/app/views/devise/registrations/_password_details.html.erb index 7d9a06d..72005e7 100644 --- a/app/views/devise/registrations/_password_details.html.erb +++ b/app/views/devise/registrations/_password_details.html.erb @@ -1,4 +1,4 @@ -<%= form_for(resource, as: resource_name, url: registration_path(resource_name, tab: 'password-details-tab'), html: {method: :put, id: "password_details_registration_form" }) do |f| %> +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: "password_details_registration_form" }) do |f| %>

<%= _('If you would like to change your password please complete the following fields.') %>

diff --git a/app/views/devise/registrations/_personal_details.html.erb b/app/views/devise/registrations/_personal_details.html.erb index 842d2e9..d3b9929 100644 --- a/app/views/devise/registrations/_personal_details.html.erb +++ b/app/views/devise/registrations/_personal_details.html.erb @@ -1,4 +1,4 @@ -<%= form_for(resource, as: resource_name, url: registration_path(resource_name, tab: 'personal-details-tab'), html: {method: :put, id: 'personal_details_registration_form' }) do |f| %> +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: {method: :put, id: 'personal_details_registration_form' }) do |f| %>

<%= _("Please note that your email address is used as your username. If you change this, remember to use your new email address on sign in.") %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index c93f4a1..5937d18 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -19,7 +19,7 @@

-
+
<%= render partial: 'devise/registrations/personal_details' %>
diff --git a/app/views/users/_notification_preferences.html.erb b/app/views/users/_notification_preferences.html.erb index f81d56a..e57e625 100644 --- a/app/views/users/_notification_preferences.html.erb +++ b/app/views/users/_notification_preferences.html.erb @@ -7,8 +7,6 @@ <%= link_to _('Deselect all'), '#', id: 'deselect_all' %>

- <%= hidden_field_tag :tab, 'notification-preferences-tab' %> -

All Users