Skip to content

Commit

Permalink
Auth links consistency on email confirmation pages. (#5961)
Browse files Browse the repository at this point in the history
Email confirmation pages can be open by logged in user.
In such case we have following inconsistency.
- Below confirmation form we have "Register" and "Log in" links.
- While at the top menu we have "Settings" and "Log out".

This change fixing inconsistency by presenting links below confirmation form only if user is not logged in.
Note: I used `if !condition` because `unless` is going to be deprecated.
  • Loading branch information
ShPakvel authored Nov 9, 2024
1 parent 13e9895 commit 1dafeeb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/confirmation_edit.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</:actions>
</.simple_form>

<p class="text-center mt-4">
<p :if={!@current_<%= schema.singular %>} class="text-center mt-4">
<.link href={~p"<%= schema.route_prefix %>/register"}>Register</.link>
| <.link href={~p"<%= schema.route_prefix %>/log_in"}>Log in</.link>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
</:actions>
</.simple_form>
<p class="text-center mt-4">
<p :if={!@current_<%= schema.singular %>} class="text-center mt-4">
<.link href={~p"<%= schema.route_prefix %>/register"}>Register</.link>
| <.link href={~p"<%= schema.route_prefix %>/log_in"}>Log in</.link>
</p>
Expand Down
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/confirmation_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule <%= inspect context.web_module %>.<%= inspect Module.concat(schema.web
</:actions>
</.simple_form>
<p class="text-center mt-4">
<p :if={!@current_<%= schema.singular %>} class="text-center mt-4">
<.link href={~p"<%= schema.route_prefix %>/register"}>Register</.link>
| <.link href={~p"<%= schema.route_prefix %>/log_in"}>Log in</.link>
</p>
Expand Down
2 changes: 1 addition & 1 deletion priv/templates/phx.gen.auth/confirmation_new.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</:actions>
</.simple_form>

<p class="text-center mt-4">
<p :if={!@current_<%= schema.singular %>} class="text-center mt-4">
<.link href={~p"<%= schema.route_prefix %>/register"}>Register</.link>
| <.link href={~p"<%= schema.route_prefix %>/log_in"}>Log in</.link>
</p>
Expand Down

0 comments on commit 1dafeeb

Please sign in to comment.