From c04e1c273673081987fc93054599b17dc1a708bd Mon Sep 17 00:00:00 2001 From: daveminer Date: Thu, 4 Jul 2024 21:52:38 -0400 Subject: [PATCH] lint --- .../pow/registration_html/edit.html.heex | 27 ++++++++--- .../pow/registration_html/new.html.heex | 19 ++++++-- .../pow/session_html/new.html.heex | 45 ++++++++++++++++--- 3 files changed, 75 insertions(+), 16 deletions(-) diff --git a/lib/basket_web/controllers/pow/registration_html/edit.html.heex b/lib/basket_web/controllers/pow/registration_html/edit.html.heex index e7870ba..ffbb756 100644 --- a/lib/basket_web/controllers/pow/registration_html/edit.html.heex +++ b/lib/basket_web/controllers/pow/registration_html/edit.html.heex @@ -4,12 +4,29 @@ <.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}> - Click the link in the confirmation email to change your email to <%= @changeset.data.unconfirmed_email %>. + <.error :if={ + Pow.Plug.extension_enabled?(@conn, PowResetPassword) && @changeset.data.unconfirmed_email + }> + + Click the link in the confirmation email to change your email to <%= @changeset.data.unconfirmed_email %>. + - <.error :if={@changeset.action}>Oops, something went wrong! Please check the errors below. - <.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. + + <.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" /> diff --git a/lib/basket_web/controllers/pow/registration_html/new.html.heex b/lib/basket_web/controllers/pow/registration_html/new.html.heex index d8ddd7f..8b692e8 100644 --- a/lib/basket_web/controllers/pow/registration_html/new.html.heex +++ b/lib/basket_web/controllers/pow/registration_html/new.html.heex @@ -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 - now. + + now. <.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. - <.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. + + <.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 /> diff --git a/lib/basket_web/controllers/pow/session_html/new.html.heex b/lib/basket_web/controllers/pow/session_html/new.html.heex index 55af426..6157ca9 100644 --- a/lib/basket_web/controllers/pow/session_html/new.html.heex +++ b/lib/basket_web/controllers/pow/session_html/new.html.heex @@ -3,22 +3,53 @@ Welcome to Basket! - + <.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. - <.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. + + <.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? <: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