-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03c48f1
commit 5b741ed
Showing
8 changed files
with
107 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Hi <%= @user.email %>, | ||
|
||
You can reset your password by visiting the URL below: | ||
|
||
<%= @url %> | ||
|
||
If you didn't request this change, please ignore this. This is an automated email. Please do not reply to this address. |
51 changes: 29 additions & 22 deletions
51
lib/atomic_web/templates/user_reset_password/edit.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,32 @@ | ||
<h1>Reset password</h1> | ||
<div class="flex flex-col items-center w-screen h-screen justify-center bg-[url('/images/atomic.png')] bg-cover bg-[length:2000px_1400px] bg-no-repeat bg-opacity-25 bg-center"> | ||
<.form let={f} for={@changeset} action={Routes.user_reset_password_path(@conn, :update, @token)} class="flex flex-col items-center justify-center w-full h-full mx-8 mt-8 space-y-6 sm:mx-0"> | ||
<h2 class="mt-6 text-center text-5xl font-extrabold text-zinc-900"> | ||
<span><%= gettext("Reset your Password") %></span> | ||
</h2> | ||
<%= if @error_message do %> | ||
<div class="alert alert-danger"> | ||
<p><%= @error_message %></p> | ||
</div> | ||
<% end %> | ||
|
||
<.form let={f} for={@changeset} action={Routes.user_reset_password_path(@conn, :update, @token)}> | ||
<%= if @changeset.action do %> | ||
<div class="alert alert-danger"> | ||
<p>Oops, something went wrong! Please check the errors below.</p> | ||
</div> | ||
<% end %> | ||
|
||
<%= label(f, :password, "New password") %> | ||
<%= password_input(f, :password, required: true) %> | ||
<%= error_tag(f, :password) %> | ||
|
||
<%= label(f, :password_confirmation, "Confirm new password") %> | ||
<%= password_input(f, :password_confirmation, required: true) %> | ||
<%= error_tag(f, :password_confirmation) %> | ||
<div class="rounded-md shadow-sm"> | ||
<%= label(f, :password, "New password", class: "sr-only") %> | ||
<%= password_input(f, :password, required: true, placeholder: gettext("New Password"), class: "relative block w-96 appearance-none rounded border border-zinc-300 px-3 py-2 text-zinc-900 placeholder-zinc-500 focus:z-10 focus:border-indigo-400 focus:outline-none sm:text-sm") %> | ||
<%= error_tag(f, :password) %> | ||
|
||
<div> | ||
<%= submit("Reset password") %> | ||
</div> | ||
</.form> | ||
<%= label(f, :password_confirmation, "Confirm new password", class: "sr-only") %> | ||
<%= password_input(f, :password_confirmation, | ||
required: true, | ||
placeholder: gettext("Confirm New Password"), | ||
class: "mt-1 relative block w-96 appearance-none rounded border border-zinc-300 px-3 py-2 text-zinc-900 placeholder-zinc-500 focus:z-10 focus:border-indigo-400 focus:outline-none sm:text-sm" | ||
) %> | ||
<%= error_tag(f, :password_confirmation) %> | ||
</div> | ||
|
||
<p> | ||
<%= link("Register", to: Routes.user_registration_path(@conn, :new)) %> | <%= link("Log in", to: Routes.user_session_path(@conn, :new)) %> | ||
</p> | ||
<div> | ||
<%= submit class: "w-64 border-2 rounded-md bg-orange-500 text-lg border-orange-500 py-2 px-3.5 text-sm font-medium text-white shadow-sm" do %> | ||
<%= gettext("Reset password") %> | ||
<% end %> | ||
</div> | ||
</.form> | ||
</div> |
43 changes: 32 additions & 11 deletions
43
lib/atomic_web/templates/user_reset_password/new.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
<h1>Forgot your password?</h1> | ||
<div class="flex flex-col items-center w-screen h-screen justify-center bg-[url('/images/atomic.png')] bg-cover bg-[length:2000px_1400px] bg-no-repeat bg-opacity-25 bg-center"> | ||
<.form let={f} for={:user} action={Routes.user_reset_password_path(@conn, :create)} class="flex flex-col items-center justify-center w-full h-full mx-8 mt-8 space-y-6 sm:mx-0"> | ||
<h2 class="mt-6 text-center text-5xl font-extrabold text-zinc-900"> | ||
<span><%= gettext("Reset your Password") %></span> | ||
</h2> | ||
<%= if @error_message do %> | ||
<div class="alert alert-danger"> | ||
<p><%= @error_message %></p> | ||
</div> | ||
<% end %> | ||
|
||
<.form let={f} for={:user} action={Routes.user_reset_password_path(@conn, :create)}> | ||
<%= label(f, :email) %> | ||
<%= email_input(f, :email, required: true) %> | ||
<div class="-space-y-px rounded-md shadow-sm"> | ||
<div> | ||
<%= label(f, :email, class: "sr-only") %> | ||
<%= email_input(f, :email, | ||
required: true, | ||
placeholder: gettext("Email address"), | ||
class: "relative block w-96 appearance-none rounded border border-zinc-300 px-3 py-2 text-zinc-900 placeholder-zinc-500 focus:z-10 focus:border-indigo-400 focus:outline-none sm:text-sm" | ||
) %> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<%= submit("Send instructions to reset password") %> | ||
</div> | ||
</.form> | ||
<div> | ||
<%= submit class: "w-64 border-2 rounded-md bg-orange-500 text-lg border-orange-500 py-2 px-3.5 text-sm font-medium text-white shadow-sm" do %> | ||
<%= gettext("Reset password") %> | ||
<% end %> | ||
</div> | ||
|
||
<p> | ||
<%= link("Register", to: Routes.user_registration_path(@conn, :new)) %> | <%= link("Log in", to: Routes.user_session_path(@conn, :new)) %> | ||
</p> | ||
<div class="flex flex-col space-y-2"> | ||
<div class="text-sm"> | ||
<%= link(gettext("Remember your password?"), to: Routes.user_session_path(@conn, :new), class: "font-medium text-orange-400 hover:text-orange-500 focus:outline-none") %> | ||
</div> | ||
</div> | ||
</.form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters