Skip to content

Commit

Permalink
regen deps
Browse files Browse the repository at this point in the history
  • Loading branch information
daveminer committed Jul 7, 2024
1 parent 26d30ce commit 9c5a041
Show file tree
Hide file tree
Showing 4 changed files with 114 additions and 16 deletions.
27 changes: 22 additions & 5 deletions lib/basket_web/controllers/pow/registration_html/edit.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,29 @@
</.header>

<.simple_form :let={f} for={@changeset} as={:user} action={@action} phx-update="ignore">
<.error :if={Pow.Plug.extension_enabled?(@conn, PowResetPassword) && @changeset.data.unconfirmed_email}>
<span>Click the link in the confirmation email to change your email to <span class="font-semibold"><%= @changeset.data.unconfirmed_email %></span>.</span>
<.error :if={
Pow.Plug.extension_enabled?(@conn, PowResetPassword) && @changeset.data.unconfirmed_email
}>
<span>
Click the link in the confirmation email to change your email to <span class="font-semibold"><%= @changeset.data.unconfirmed_email %></span>.
</span>
</.error>
<.error :if={@changeset.action}>Oops, something went wrong! Please check the errors below.</.error>
<.input field={f[:current_password]} type="password" label="Current password" value={nil} required />
<.input field={f[Pow.Ecto.Schema.user_id_field(@changeset)]} type={Pow.Ecto.Schema.user_id_field(@changeset) == :email && "email" || "text"} label={Phoenix.Naming.humanize(Pow.Ecto.Schema.user_id_field(@changeset))} required />
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input
field={f[:current_password]}
type="password"
label="Current password"
value={nil}
required
/>
<.input
field={f[Pow.Ecto.Schema.user_id_field(@changeset)]}
type={(Pow.Ecto.Schema.user_id_field(@changeset) == :email && "email") || "text"}
label={Phoenix.Naming.humanize(Pow.Ecto.Schema.user_id_field(@changeset))}
required
/>
<.input field={f[:password]} type="password" label="New password" />
<.input field={f[:password_confirmation]} type="password" label="Confirm new password" />

Expand Down
19 changes: 15 additions & 4 deletions lib/basket_web/controllers/pow/registration_html/new.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@
Register
<:subtitle>
Already have an account?
<.link navigate={Pow.Phoenix.Routes.path_for(@conn, Pow.Phoenix.SessionController, :new)} class="font-semibold text-brand hover:underline">
<.link
navigate={Pow.Phoenix.Routes.path_for(@conn, Pow.Phoenix.SessionController, :new)}
class="font-semibold text-brand hover:underline"
>
Sign in
</.link> now.
</.link>
now.
</:subtitle>
</.header>

<.simple_form :let={f} for={@changeset} as={:user} action={@action} phx-update="ignore">
<.error :if={@changeset.action}>Oops, something went wrong! Please check the errors below.</.error>
<.input field={f[Pow.Ecto.Schema.user_id_field(@changeset)]} type={Pow.Ecto.Schema.user_id_field(@changeset) == :email && "email" || "text"} label={Phoenix.Naming.humanize(Pow.Ecto.Schema.user_id_field(@changeset))} required />
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input
field={f[Pow.Ecto.Schema.user_id_field(@changeset)]}
type={(Pow.Ecto.Schema.user_id_field(@changeset) == :email && "email") || "text"}
label={Phoenix.Naming.humanize(Pow.Ecto.Schema.user_id_field(@changeset))}
required
/>
<.input field={f[:password]} type="password" label="Password" required />
<.input field={f[:password_confirmation]} type="password" label="Confirm password" required />

Expand Down
45 changes: 38 additions & 7 deletions lib/basket_web/controllers/pow/session_html/new.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,53 @@
Welcome to Basket!
</.header>

<img src={~p"/images/stock_basket.webp"} width="216" class="mx-auto block"/>
<img src={~p"/images/stock_basket.webp"} width="216" class="mx-auto block" />

<.simple_form :let={f} for={@changeset} as={:user} action={@action} phx-update="ignore">
<.error :if={@changeset.action}>Oops, something went wrong! Please check the errors below.</.error>
<.input field={f[Pow.Ecto.Schema.user_id_field(@changeset)]} type={Pow.Ecto.Schema.user_id_field(@changeset) == :email && "email" || "text"} label={Phoenix.Naming.humanize(Pow.Ecto.Schema.user_id_field(@changeset))} required />
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input
field={f[Pow.Ecto.Schema.user_id_field(@changeset)]}
type={(Pow.Ecto.Schema.user_id_field(@changeset) == :email && "email") || "text"}
label={Phoenix.Naming.humanize(Pow.Ecto.Schema.user_id_field(@changeset))}
required
/>
<.input field={f[:password]} type="password" label="Password" value={nil} required />

<:actions :let={f} :if={Pow.Plug.extension_enabled?(@conn, PowPersistentSession) || Pow.Plug.extension_enabled?(@conn, PowResetPassword)}>
<.input :if={Pow.Plug.extension_enabled?(@conn, PowPersistentSession)} field={f[:persistent_session]} type="checkbox" label="Keep me logged in" />
<.link :if={Pow.Plug.extension_enabled?(@conn, PowResetPassword)} href={Pow.Phoenix.Routes.path_for(@conn, PowResetPassword.Phoenix.ResetPasswordController, :new)} class="text-sm font-semibold">
<:actions
:let={f}
:if={
Pow.Plug.extension_enabled?(@conn, PowPersistentSession) ||
Pow.Plug.extension_enabled?(@conn, PowResetPassword)
}
>
<.input
:if={Pow.Plug.extension_enabled?(@conn, PowPersistentSession)}
field={f[:persistent_session]}
type="checkbox"
label="Keep me logged in"
/>
<.link
:if={Pow.Plug.extension_enabled?(@conn, PowResetPassword)}
href={
Pow.Phoenix.Routes.path_for(
@conn,
PowResetPassword.Phoenix.ResetPasswordController,
:new
)
}
class="text-sm font-semibold"
>
Forgot your password?
</.link>
</:actions>

<:actions>
<.button phx-disable-with="Signing in..." class="w-full text-black bg-gray-300 hover:bg-gray-400">
<.button
phx-disable-with="Signing in..."
class="w-full text-black bg-gray-300 hover:bg-gray-400"
>
Sign in <span aria-hidden="true">→</span>
</.button>
</:actions>
Expand Down
Loading

0 comments on commit 9c5a041

Please sign in to comment.