From 039419a2d82bb2e39ba04f1c7e95e3a7fbeb1157 Mon Sep 17 00:00:00 2001
From: Arnaud Levy <contact@arnaudlevy.com>
Date: Thu, 6 Apr 2023 16:19:36 +0200
Subject: [PATCH] better

---
 .../two_factor_authentication/show.html.erb   | 55 +++++++++----------
 1 file changed, 25 insertions(+), 30 deletions(-)

diff --git a/app/views/devise/two_factor_authentication/show.html.erb b/app/views/devise/two_factor_authentication/show.html.erb
index 5fab80bda..e200bb69b 100644
--- a/app/views/devise/two_factor_authentication/show.html.erb
+++ b/app/views/devise/two_factor_authentication/show.html.erb
@@ -15,39 +15,34 @@
 </p>
 
 <%= simple_form_for(resource, url: user_two_factor_authentication_path, html: { method: :put, class: 'my-3' }) do |f| %>
-  <div class="row pure__row--small">
-    <div class="col-lg-6">
-      <div class="form-inputs">
-        <div class="form-group required mt-0">
-          <%= text_field_tag :code,
-                              '',
-                              type: 'tel',
-                              pattern: '\d*',
-                              required: true,
-                              autofocus: true,
-                              autocomplete: 'off',
-                              class: 'form-control string required'%>
-          <p class="mt-2 mb-5">
-            <% if resource.direct_otp %>
-              <%= link_to t('devise.two_factor_authentication.resend_code'), [:resend_code, resource_name, :two_factor_authentication] %>
-            <% else %>
-              <%= link_to t('devise.two_factor_authentication.send_code_instead'), [:resend_code, resource_name, :two_factor_authentication] %>
-            <% end %>
-            <% unless resource.mobile_phone.blank? # when phone is blank default code method is already :email so we don't need another link %>
-              • <%= link_to t('devise.two_factor_authentication.send_email_code'), [:resend_code, resource_name, :two_factor_authentication, delivery_method: :email] %>
-            <% end %>
-          </p>
-        </div>
-      </div>
-    </div>
-    <div class="col-lg-6">
-      <%= link_to t('devise.shared.links.sign_out'),
-                  destroy_user_session_path,
-                  method: :delete,
-                  class: "btn btn-outline-danger" %>
+  <div class="form-inputs">
+    <div class="input-group required mt-0" style="max-width: 400px">
+      <%= text_field_tag :code,
+                          '',
+                          type: 'tel',
+                          pattern: '\d*',
+                          required: true,
+                          autofocus: true,
+                          autocomplete: 'off',
+                          class: 'form-control string required'%>
       <%= f.button  :submit,
                     t('devise.two_factor_authentication.validate'),
                     class: "btn btn-primary" %>
     </div>
+    <p class="mt-4 mb-5">
+      <% if resource.direct_otp %>
+        <%= link_to t('devise.two_factor_authentication.resend_code'), [:resend_code, resource_name, :two_factor_authentication] %>
+      <% else %>
+        <%= link_to t('devise.two_factor_authentication.send_code_instead'), [:resend_code, resource_name, :two_factor_authentication] %>
+      <% end %>
+      <% unless resource.mobile_phone.blank? # when phone is blank default code method is already :email so we don't need another link %>
+        • <%= link_to t('devise.two_factor_authentication.send_email_code'), [:resend_code, resource_name, :two_factor_authentication, delivery_method: :email] %>
+      <% end %>
+    </p>
   </div>
 <% end %>
+
+<%= link_to t('devise.shared.links.sign_out'),
+            destroy_user_session_path,
+            method: :delete,
+            class: "btn btn-outline-danger" %>
-- 
GitLab