From ea99805da1ff4addae6527da2ac5ef2a6895ff86 Mon Sep 17 00:00:00 2001 From: Dominik Kwiatek Date: Mon, 19 Oct 2020 15:55:00 +0200 Subject: [PATCH] Fix remaining lint warnings --- app/views/discover/_userbox.haml | 5 +++-- app/views/settings/_security.haml | 14 ++++++++++++-- app/views/user/edit_security.haml | 2 +- app/views/user/security.html.erb | 0 config/locales/en.yml | 1 + 5 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 app/views/user/security.html.erb diff --git a/app/views/discover/_userbox.haml b/app/views/discover/_userbox.haml index b087ca2f..8ae7567f 100644 --- a/app/views/discover/_userbox.haml +++ b/app/views/discover/_userbox.haml @@ -14,9 +14,10 @@ = u.display_name %span.text-muted= u.screen_name %p.answerbox__question-text - - if type == 'new' + - case type + - when 'new' = t('views.discover.userbox.new', time: time_ago_in_words(u.created_at)) - - elsif type == 'most' + - when 'most' = t('views.discover.userbox.answers', questions: pluralize(a, t('views.general.question'))) - else = t('views.discover.userbox.questions', questions: pluralize(q, t('views.general.question'))) diff --git a/app/views/settings/_security.haml b/app/views/settings/_security.haml index cba67b8b..90e7dc27 100644 --- a/app/views/settings/_security.haml +++ b/app/views/settings/_security.haml @@ -6,7 +6,7 @@ .totp-setup__left .totp-setup__card .totp-setup__qr - = @qr_svg + = qr_svg %p.totp-setup__text If you cannot scan the QR code, use the following key instead: %code= current_user.otp_secret_key.scan(/.{4}/).flatten.join(' ') @@ -31,10 +31,20 @@ %ul.list-inline %li.list-inline-item %a{ href: 'https://apps.apple.com/gb/app/strongbox-authenticator/id1023839880' } App Store + %li + %i.fa.fa-apple + %i.fa.fa-android + Microsoft Authenticator + %ul.list-inline + %li.list-inline-item + %a{ href: 'https://apps.apple.com/gb/app/microsoft-authenticator/id983156458' } App Store + %li.list-inline-item + %a{ href: 'https://play.google.com/store/apps/details?id=com.azure.authenticator' } Google Play %p Once you have downloaded an authenticator app, add your Retrospring account by scanning the QR code displayed on the left. = f.text_field :otp_validation, class: 'totp-setup__code-field', label: 'Enter the code displayed in the app here:' = f.hidden_field :otp_secret_key, value: current_user.otp_secret_key = f.submit t('views.actions.save'), class: 'btn btn-primary' - else %p Your account is set up to require the use of a one-time password in order to log in - = link_to t('views.actions.remove'), destroy_user_2fa_path, class: 'btn btn-primary', method: 'delete', data: { confirm: 'Are you sure you want to disable two-factor authentication?' } + = link_to t('views.actions.remove'), destroy_user_2fa_path, class: 'btn btn-primary', method: 'delete', + data: { confirm: t('views.settings.security.2fa.detach_confirm') } diff --git a/app/views/user/edit_security.haml b/app/views/user/edit_security.haml index 41d8ef4d..bcdebbea 100644 --- a/app/views/user/edit_security.haml +++ b/app/views/user/edit_security.haml @@ -1,4 +1,4 @@ -= render 'settings/security' += render 'settings/security', qr_svg: @qr_svg - provide(:title, generate_title('Security Settings')) - parent_layout 'user/settings' diff --git a/app/views/user/security.html.erb b/app/views/user/security.html.erb deleted file mode 100644 index e69de29b..00000000 diff --git a/config/locales/en.yml b/config/locales/en.yml index 95d98ea5..89d295f1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -419,6 +419,7 @@ en: security: 2fa: title: "Two-factor authentication" + detach_confirm: "Are you sure you want to disable two-factor authentication?" modal: ask: title: "Ask your followers"