2022-08-13 09:26:09 -04:00
|
|
|
<div id={@id} class="col-12 col-sm-10 col-md-6 col-lg-5 col-xl-4 col-xxl-3 mt-1">
|
2021-03-02 16:48:00 -05:00
|
|
|
|
2021-03-03 08:15:14 -05:00
|
|
|
<h3>Change email</h3>
|
2021-03-02 16:48:00 -05:00
|
|
|
|
|
|
|
<%= form_for @changeset, "#", [phx_change: :validate, phx_submit: :save, phx_target: @myself], fn f -> %>
|
|
|
|
|
2021-03-09 10:22:05 -05:00
|
|
|
<%= label f, :email, class: "form-label" %>
|
2022-08-13 09:26:09 -04:00
|
|
|
<div class="inner-addon left-addon mb-3" phx-feedback-for={input_id(f, :email)}>
|
|
|
|
<i class="bi bi-at icon is-left text-muted fs-5"></i>
|
2021-03-07 17:17:16 -05:00
|
|
|
<%= email_input f, :email,
|
|
|
|
value: input_value(f, :email),
|
|
|
|
class: input_class(f, :email, "form-control"),
|
|
|
|
placeholder: "e.g., babka@73k.us",
|
|
|
|
maxlength: User.max_email,
|
|
|
|
phx_debounce: "500",
|
|
|
|
aria_describedby: error_ids(f, :email)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :email %>
|
2021-03-02 16:48:00 -05:00
|
|
|
</div>
|
|
|
|
|
2021-03-09 10:22:05 -05:00
|
|
|
<%= label f, :current_password, class: "form-label" %>
|
2021-03-09 10:48:23 -05:00
|
|
|
<div class="inner-addon left-addon mb-3">
|
2022-08-13 09:26:09 -04:00
|
|
|
<i class="bi bi-lock icon is-left text-muted fs-5"></i>
|
2021-03-07 17:17:16 -05:00
|
|
|
<%= password_input f, :current_password,
|
|
|
|
value: input_value(f, :current_password),
|
2021-03-09 10:48:23 -05:00
|
|
|
id: "user_email_current_password",
|
|
|
|
class: "form-control"
|
2021-03-07 17:17:16 -05:00
|
|
|
%>
|
2021-03-02 16:48:00 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
<%= submit "Change email",
|
|
|
|
class: "btn btn-primary",
|
2021-03-04 22:03:27 -05:00
|
|
|
disabled: !@changeset.valid? || input_value(f, :current_password) == "",
|
|
|
|
aria_disabled: (!@changeset.valid? || input_value(f, :current_password) == "") && "true" || false,
|
2021-03-02 16:48:00 -05:00
|
|
|
phx_disable_with: "Saving..."
|
|
|
|
%>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
</div>
|