2021-03-02 10:35:36 -05:00
|
|
|
<div class="row justify-content-center">
|
2021-03-10 09:27:24 -05:00
|
|
|
<div class="col-11 col-sm-8 col-md-6 col-lg-5 col-xl-4 col-xxl-3">
|
2021-03-02 10:35:36 -05:00
|
|
|
|
2021-03-03 08:15:14 -05:00
|
|
|
<h2>
|
2022-08-13 09:26:09 -04:00
|
|
|
<i class="bi bi-shield-lock me-1"></i> Reset password
|
2021-03-03 08:15:14 -05:00
|
|
|
</h2>
|
2021-03-10 09:27:24 -05:00
|
|
|
<p class="lead">Hi <%= @user.email %> — tell us your new password, please.</p>
|
2021-03-02 10:35:36 -05:00
|
|
|
|
2022-08-14 09:22:39 -04:00
|
|
|
<.form let={f} for={@changeset} phx-change="validate" phx-submit="save" novalidate id="pw_reset_form">
|
2021-03-02 10:35:36 -05:00
|
|
|
|
2021-03-09 10:22:05 -05:00
|
|
|
<%= label f, :password, "New password", 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, :password)}>
|
|
|
|
<i class="bi bi-key icon is-left text-muted fs-5"></i>
|
2021-03-07 17:17:16 -05:00
|
|
|
<%= password_input f, :password,
|
|
|
|
value: input_value(f, :password),
|
|
|
|
class: input_class(f, :password, "form-control"),
|
|
|
|
maxlength: User.max_password,
|
|
|
|
autofocus: true,
|
|
|
|
aria_describedby: error_ids(f, :password)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :password %>
|
2021-03-02 10:35:36 -05:00
|
|
|
</div>
|
|
|
|
|
2021-03-09 10:22:05 -05:00
|
|
|
<%= label f, :password_confirmation, "Confirm new password", 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, :password_confirmation)}>
|
|
|
|
<i class="bi bi-key-fill icon is-left text-muted fs-5"></i>
|
2021-03-07 17:17:16 -05:00
|
|
|
<%= password_input f, :password_confirmation,
|
|
|
|
value: input_value(f, :password_confirmation),
|
|
|
|
class: input_class(f, :password_confirmation, "form-control"),
|
|
|
|
maxlength: User.max_password,
|
|
|
|
aria_describedby: error_ids(f, :password_confirmation)
|
|
|
|
%>
|
|
|
|
<%= error_tag f, :password_confirmation %>
|
2021-03-02 10:35:36 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="mb-3">
|
2021-03-04 22:03:27 -05:00
|
|
|
<%= submit "Reset password",
|
|
|
|
class: "btn btn-primary",
|
|
|
|
disabled: !@changeset.valid?,
|
|
|
|
aria_disabled: !@changeset.valid? && "true" || false,
|
|
|
|
phx_disable_with: "Saving..."
|
|
|
|
%>
|
2021-03-02 10:35:36 -05:00
|
|
|
</div>
|
|
|
|
|
2022-08-14 09:22:39 -04:00
|
|
|
</.form>
|
2021-03-02 10:35:36 -05:00
|
|
|
|
|
|
|
<p class="mt-3 is-pulled-right">
|
2022-08-14 09:14:42 -04:00
|
|
|
<%= if allow_registration() do %>
|
|
|
|
<%= link "Register", to: Routes.user_registration_path(@socket, :new) %> |
|
|
|
|
<% end %>
|
2021-03-02 10:35:36 -05:00
|
|
|
<%= link "Log in", to: Routes.user_session_path(@socket, :new) %>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|