scinote-web/app/views/users/registrations/_2fa_modal.html.erb

40 lines
1.8 KiB
Text
Raw Normal View History

2020-06-29 16:56:06 +08:00
<div class="modal" id="twoFactorAuthenticationModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span></button>
2020-07-01 17:07:33 +08:00
<h2 class="modal-title"><%= t("users.registrations.edit.2fa_modal.title") %></h2>
2020-06-29 16:56:06 +08:00
</div>
2020-07-01 17:07:33 +08:00
<% if current_user.two_factor_auth_enabled? %>
<%= form_with(url: users_2fa_disable_path, method: "post", class: "2fa-disable-form") do %>
<div class="modal-body">
<div class="sci-input-container password-field">
<%= label_tag :password, t("users.registrations.edit.2fa_modal.password_label") %>
<%= password_field_tag :password, '', class: "sci-input-field" %>
</div>
</div>
<div class="modal-footer">
<%= button_tag t("users.registrations.edit.2fa_modal.submit_button"), type: 'submit', class: "btn btn-danger" %>
</div>
<% end %>
<% else %>
<%= form_with(url: users_2fa_enable_path, method: "post", class: "2fa-enable-form") do %>
<div class="modal-body">
<div class="qr-code"></div>
<div class="sci-input-container submit-code-field">
<%= label_tag :submit_code, t("users.registrations.edit.2fa_modal.submit_code_label") %>
<%= text_field_tag :submit_code, '', class: "sci-input-field" %>
</div>
</div>
<div class="modal-footer">
<%= button_tag t("users.registrations.edit.2fa_modal.submit_button"), type: 'submit', class: "btn btn-primary" %>
</div>
<% end %>
<% end %>
2020-06-29 16:56:06 +08:00
</div>
</div>
</div>
</div>
2020-06-29 16:57:41 +08:00