From a37fdcdfdb1bae2968a58f3545bd3344ba050106 Mon Sep 17 00:00:00 2001 From: FilipeR13 Date: Tue, 29 Oct 2024 00:28:40 +0000 Subject: [PATCH] fix: Routes --- lib/atomic_web/components/unauthenticated.ex | 6 +++--- .../components/follow_suggestions/suggestion.ex | 2 +- .../live/home_live/components/schedule.ex | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/atomic_web/components/unauthenticated.ex b/lib/atomic_web/components/unauthenticated.ex index c42a3044..9b90676e 100644 --- a/lib/atomic_web/components/unauthenticated.ex +++ b/lib/atomic_web/components/unauthenticated.ex @@ -12,10 +12,10 @@ defmodule AtomicWeb.Components.Unauthenticated do
<.icon name="hero-user-circle" class="mx-auto h-12 w-12 text-zinc-400" />

You are not authenticated

-

Please sign in to view this content.

+

Please log in to view this content.

- <.button patch={Routes.user_session_path(AtomicWeb.Endpoint, :new)} icon="hero-arrow-right-end-on-rectangle-solid" icon_position={:right} class="w-fit"> - <%= gettext("Sign in") %> + <.button patch={~p"/users/log_in"} icon="hero-arrow-right-end-on-rectangle-solid" icon_position={:right} class="w-fit"> + <%= gettext("Log In") %>
diff --git a/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex b/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex index 6b9f7b38..ae4244c8 100644 --- a/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex +++ b/lib/atomic_web/live/home_live/components/follow_suggestions/suggestion.ex @@ -57,7 +57,7 @@ defmodule AtomicWeb.HomeLive.Components.FollowSuggestions.Suggestion do {:noreply, socket |> put_flash(:info, "You must be logged in to follow organizations") - |> redirect(to: Routes.user_session_path(AtomicWeb.Endpoint, :new))} + |> redirect(to: ~p"/users/log_in")} end @impl true diff --git a/lib/atomic_web/live/home_live/components/schedule.ex b/lib/atomic_web/live/home_live/components/schedule.ex index 26f1607a..e6bef71f 100644 --- a/lib/atomic_web/live/home_live/components/schedule.ex +++ b/lib/atomic_web/live/home_live/components/schedule.ex @@ -43,13 +43,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do <%= if check_enrolled(entry, @current_user) do %>
<.icon name="hero-user-group-solid" class="size-4 font-bold text-green-500" /> - <.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, entry.organization.id)} class="text-xs text-zinc-400 hover:underline"> + <.link navigate={~p"/organizations/#{entry.organization_id}"} class="text-xs text-zinc-400 hover:underline"> <%= entry.organization.name %>
<% else %>
- <.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, entry.organization.id)} class="text-xs text-zinc-400 hover:underline"> + <.link navigate={~p"/organizations/#{entry.organization_id}"} class="text-xs text-zinc-400 hover:underline"> <%= entry.organization.name %>
@@ -86,13 +86,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do <%= if check_enrolled(entry, @current_user) do %>
<.icon name="hero-user-group-solid" class="size-4 font-bold text-green-500" /> - <.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, entry.organization.id)} class="text-xs text-zinc-400 hover:underline"> + <.link navigate={~p"/organizations/#{entry.organization_id}"} class="text-xs text-zinc-400 hover:underline"> <%= entry.organization.name %>
<% else %>
- <.link navigate={Routes.organization_show_path(AtomicWeb.Endpoint, :show, entry.organization.id)} class="text-xs text-zinc-400 hover:underline"> + <.link navigate={~p"/organizations/#{entry.organization.id}"} class="text-xs text-zinc-400 hover:underline"> <%= entry.organization.name %>
@@ -117,15 +117,15 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do

<%= gettext("Try enrolling in some activities.") %>

- <.button patch={Routes.activity_index_path(AtomicWeb.Endpoint, :index)} color={:white} size={:xs} icon="hero-academic-cap"> + <.button patch={~p"/activities"} color={:white} size={:xs} icon="hero-academic-cap"> <%= gettext("Browse activities") %> <% else %>

- <%= gettext("You need to be loged in to see your schedule.") %> + <%= gettext("You need to be logged in to see your schedule.") %>

- <.button patch={Routes.user_session_path(AtomicWeb.Endpoint, :new)} icon="hero-arrow-right-end-on-rectangle-solid" color={:white} icon_position={:right} size={:xs}> - <%= gettext("Sign in") %> + <.button patch={~p"/users/log_in"} icon="hero-arrow-right-end-on-rectangle-solid" color={:white} icon_position={:right} size={:xs}> + <%= gettext("Log In") %> <% end %> """