From 6fa97d3639a3340019f8d50af13c0663672389b9 Mon Sep 17 00:00:00 2001 From: aignatov-bio Date: Mon, 29 Jun 2020 10:56:06 +0200 Subject: [PATCH] Add enable 2fa button to user settings --- app/assets/javascripts/users/registrations/edit.js | 4 ++++ app/views/users/registrations/_2fa_modal.html.erb | 12 ++++++++++++ app/views/users/registrations/edit.html.erb | 3 ++- config/locales/en.yml | 1 + 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 app/views/users/registrations/_2fa_modal.html.erb diff --git a/app/assets/javascripts/users/registrations/edit.js b/app/assets/javascripts/users/registrations/edit.js index cd2a5d551..7d02da59b 100644 --- a/app/assets/javascripts/users/registrations/edit.js +++ b/app/assets/javascripts/users/registrations/edit.js @@ -79,4 +79,8 @@ } $fileInput[0].value = ''; }); + + $('#twoFactorAuthentication').click(function() { + $('#twoFactorAuthenticationModal').modal('show'); + }); }()); diff --git a/app/views/users/registrations/_2fa_modal.html.erb b/app/views/users/registrations/_2fa_modal.html.erb new file mode 100644 index 000000000..04e217a2b --- /dev/null +++ b/app/views/users/registrations/_2fa_modal.html.erb @@ -0,0 +1,12 @@ + diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb index 3f087e933..aca9cef15 100644 --- a/app/views/users/registrations/edit.html.erb +++ b/app/views/users/registrations/edit.html.erb @@ -142,7 +142,7 @@ <% end %> - +
@@ -176,6 +176,7 @@
+<%= render partial: '2fa_modal' %> <%= render partial: 'users/shared/user_avatars_modal' %> <%= javascript_pack_tag 'custom/croppie' %> diff --git a/config/locales/en.yml b/config/locales/en.yml index ef998024b..81a487b8b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1593,6 +1593,7 @@ en: password_title: "Change password" new_password_label: "New password" new_password_2_label: "New password confirmation" + 2fa_button: "Enable two-factor authentication" new: head_title: "Sign up" team_name_label: "Team name"