Skip to content
Snippets Groups Projects
Commit 039419a2 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

better

parent 33d6b1a4
No related branches found
No related tags found
No related merge requests found
......@@ -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" %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment