scinote-web/app/views/users/registrations/edit_partials/_email.html.erb

39 lines
1.9 KiB
Text
Raw Normal View History

2020-07-07 19:17:17 +08:00
<%= form_for(resource,
as: resource_name,
url: registration_path(resource_name, format: :json),
remote: true,
html: { method: :put, "data-for" => "email", class: 'settings-page-email', id: 'user-email-field' }) do |f| %>
<div data-part="view">
<div class="form-group">
<%= f.label t("users.registrations.edit.email_label") %>
2020-07-07 21:59:02 +08:00
<div class="user-attribute">
<%= @user.email %>
2020-07-27 19:42:51 +08:00
<a href="#" class="btn btn-default" data-action="edit"><%= t("general.change") %></a>
2020-07-07 19:17:17 +08:00
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div class="alert alert-info" style="margin-top: 15px;" role="alert">
<span class="fas fa-info-circle" aria-hidden="true"></span>
<%=t "users.registrations.edit.waiting_for_confirm", email: resource.unconfirmed_email %>
</div>
<% end %>
</div>
</div>
<div data-part="edit" style="display: none;">
<div class="well">
<h4><%=t "users.registrations.edit.email_title" %></h4>
2020-07-07 21:59:02 +08:00
<div class="form-group sci-input-container">
2020-07-07 19:17:17 +08:00
<%= f.label :email, t("users.registrations.edit.new_email_label") %>
2020-07-07 21:59:02 +08:00
<%= f.email_field :email, class: "form-control sci-input-field", "data-role" => "edit" %>
2020-07-07 19:17:17 +08:00
</div>
2020-07-07 21:59:02 +08:00
<div class="form-group sci-input-container">
2020-07-07 19:17:17 +08:00
<%= f.label :current_password, t("users.registrations.edit.current_password_label") %> <i><%=t "users.registrations.edit.password_explanation" %></i>
2020-07-07 21:59:02 +08:00
<%= f.password_field :current_password, autocomplete: "off", class: "form-control sci-input-field", "data-role" => "clear", id: 'edit-email-current-password' %>
2020-07-07 19:17:17 +08:00
</div>
<div class="align-right">
2020-07-07 21:59:02 +08:00
<a href="#" class="btn btn-light" data-action="cancel"><%=t "general.cancel" %></a>
2020-07-22 19:16:27 +08:00
<%= f.button t("general.save"), class: "btn btn-success" %>
2020-07-07 19:17:17 +08:00
</div>
</div>
</div>
<% end %>