Skip to content

Commit

Permalink
fix: Routes
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipeR13 committed Oct 29, 2024
1 parent d949fde commit a37fdcd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions lib/atomic_web/components/unauthenticated.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ defmodule AtomicWeb.Components.Unauthenticated do
<div id={@id} class="text-center">
<.icon name="hero-user-circle" class="mx-auto h-12 w-12 text-zinc-400" />
<h3 class="mt-2 text-sm font-semibold text-zinc-900">You are not authenticated</h3>
<p class="mt-1 text-sm text-zinc-500">Please sign in to view this content.</p>
<p class="mt-1 text-sm text-zinc-500">Please log in to view this content.</p>
<div class="mt-4 flex justify-center">
<.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") %>
</.button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions lib/atomic_web/live/home_live/components/schedule.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
<%= if check_enrolled(entry, @current_user) do %>
<div class="flex justify-between pt-2">
<.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 %>
</.link>
</div>
<% else %>
<div class="pt-2 text-right">
<.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 %>
</.link>
</div>
Expand Down Expand Up @@ -86,13 +86,13 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
<%= if check_enrolled(entry, @current_user) do %>
<div class="flex justify-between pt-2">
<.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 %>
</.link>
</div>
<% else %>
<div class="pt-2 text-right">
<.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 %>
</.link>
</div>
Expand All @@ -117,15 +117,15 @@ defmodule AtomicWeb.HomeLive.Components.Schedule do
<p>
<%= gettext("Try enrolling in some activities.") %>
</p>
<.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") %>
</.button>
<% else %>
<p>
<%= gettext("You need to be loged in to see your schedule.") %>
<%= gettext("You need to be logged in to see your schedule.") %>
</p>
<.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") %>
</.button>
<% end %>
"""
Expand Down

0 comments on commit a37fdcd

Please sign in to comment.