Compare commits
No commits in common. "3a1060826f145b6cba0a68db6a97547771da25fd" and "6cbcd313eed3721e1ff4b3fa6a01d53549e60768" have entirely different histories.
3a1060826f
...
6cbcd313ee
5 changed files with 27 additions and 45 deletions
|
@ -1,6 +1,6 @@
|
||||||
<main class="container">
|
<main class="container">
|
||||||
<.flash_group flash={@flash} />
|
<.flash_group flash={@flash} />
|
||||||
<.navbar is-fixed-top is-light>
|
<.navbar is-fixed-top>
|
||||||
<.navbar_brand>
|
<.navbar_brand>
|
||||||
<.navbar_item>
|
<.navbar_item>
|
||||||
<.title is-4>
|
<.title is-4>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
</.navbar_brand>
|
</.navbar_brand>
|
||||||
|
|
||||||
<.navbar_menu id="navbar_top">
|
<.navbar_menu id="navbar_top">
|
||||||
<%!-- <%= if @current_user do %>
|
<%= if @current_user do %>
|
||||||
<.navbar_start>
|
<.navbar_start>
|
||||||
<.navbar_item has-dropdown is-hoverable>
|
<.navbar_item has-dropdown is-hoverable>
|
||||||
<.navbar_link>
|
<.navbar_link>
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</.navbar_dropdown>
|
</.navbar_dropdown>
|
||||||
</.navbar_item>
|
</.navbar_item>
|
||||||
</.navbar_start>
|
</.navbar_start>
|
||||||
<% end %> --%>
|
<% end %>
|
||||||
|
|
||||||
<.navbar_end>
|
<.navbar_end>
|
||||||
<%= if @current_user do %>
|
<%= if @current_user do %>
|
||||||
|
@ -64,16 +64,16 @@
|
||||||
</.navbar_link>
|
</.navbar_link>
|
||||||
|
|
||||||
<.navbar_dropdown>
|
<.navbar_dropdown>
|
||||||
<%!-- <.navbar_item>
|
<.navbar_item>
|
||||||
<.link>Software Updates</.link>
|
<.link>Software Updates</.link>
|
||||||
</.navbar_item>
|
</.navbar_item>
|
||||||
<.navbar_divider />
|
<.navbar_divider />
|
||||||
<.navbar_item>
|
<.navbar_item>
|
||||||
<.link>Packages</.link>
|
<.link>Packages</.link>
|
||||||
</.navbar_item> --%>
|
</.navbar_item>
|
||||||
<.link href={~p"/services"} class="navbar-item">
|
<.navbar_item>
|
||||||
Services
|
<.link>Services</.link>
|
||||||
</.link>
|
</.navbar_item>
|
||||||
</.navbar_dropdown>
|
</.navbar_dropdown>
|
||||||
</.navbar_item>
|
</.navbar_item>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -84,16 +84,22 @@
|
||||||
|
|
||||||
<.navbar_dropdown>
|
<.navbar_dropdown>
|
||||||
<%= if @current_user do %>
|
<%= if @current_user do %>
|
||||||
<.link href={~p"/users/settings"} class="navbar-item">
|
<.navbar_item>
|
||||||
|
<.link href={~p"/users/settings"}>
|
||||||
Settings
|
Settings
|
||||||
</.link>
|
</.link>
|
||||||
<.link href={~p"/users/log_out"} method="delete" class="navbar-item">
|
</.navbar_item>
|
||||||
|
<.navbar_item>
|
||||||
|
<.link href={~p"/users/log_out"} method="delete">
|
||||||
Log out
|
Log out
|
||||||
</.link>
|
</.link>
|
||||||
|
</.navbar_item>
|
||||||
<% else %>
|
<% else %>
|
||||||
<.link href={~p"/users/log_in"} class="navbar-item">
|
<.navbar_item>
|
||||||
|
<.link href={~p"/users/log_in"}>
|
||||||
Log in
|
Log in
|
||||||
</.link>
|
</.link>
|
||||||
|
</.navbar_item>
|
||||||
<% end %>
|
<% end %>
|
||||||
</.navbar_dropdown>
|
</.navbar_dropdown>
|
||||||
</.navbar_item>
|
</.navbar_item>
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
defmodule FreediveWeb.HomeLive do
|
|
||||||
use FreediveWeb, :live_view
|
|
||||||
|
|
||||||
def render(assigns) do
|
|
||||||
~H"""
|
|
||||||
<.section>
|
|
||||||
<.title>Home</.title>
|
|
||||||
</.section>
|
|
||||||
"""
|
|
||||||
end
|
|
||||||
|
|
||||||
def mount(_params, _session, socket) do
|
|
||||||
{:ok, socket}
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -20,7 +20,7 @@ defmodule FreediveWeb.Router do
|
||||||
scope "/", FreediveWeb do
|
scope "/", FreediveWeb do
|
||||||
pipe_through :browser
|
pipe_through :browser
|
||||||
|
|
||||||
# get "/", PageController, :home
|
get "/", PageController, :home
|
||||||
end
|
end
|
||||||
|
|
||||||
# Other scopes may use custom stacks.
|
# Other scopes may use custom stacks.
|
||||||
|
@ -68,7 +68,6 @@ defmodule FreediveWeb.Router do
|
||||||
|
|
||||||
live_session :require_authenticated_user,
|
live_session :require_authenticated_user,
|
||||||
on_mount: [{FreediveWeb.UserAuth, :ensure_authenticated}] do
|
on_mount: [{FreediveWeb.UserAuth, :ensure_authenticated}] do
|
||||||
live "/", HomeLive
|
|
||||||
live "/users/settings", UserSettingsLive, :edit
|
live "/users/settings", UserSettingsLive, :edit
|
||||||
live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email
|
live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,6 +3,6 @@ defmodule FreediveWeb.PageControllerTest do
|
||||||
|
|
||||||
test "GET /", %{conn: conn} do
|
test "GET /", %{conn: conn} do
|
||||||
conn = get(conn, ~p"/")
|
conn = get(conn, ~p"/")
|
||||||
assert html_response(conn, 302) =~ "redirected"
|
assert html_response(conn, 200) =~ "Under Construction"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -51,12 +51,8 @@ defmodule FreediveWeb.UserConfirmationLiveTest do
|
||||||
|
|
||||||
assert {:ok, conn} = result
|
assert {:ok, conn} = result
|
||||||
|
|
||||||
# Home is now behind login page and only latest flash message is shown
|
|
||||||
assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
||||||
"You must log in to access this page."
|
"User confirmation link is invalid or it has expired"
|
||||||
|
|
||||||
# assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
|
||||||
# "User confirmation link is invalid or it has expired"
|
|
||||||
|
|
||||||
# when logged in
|
# when logged in
|
||||||
conn =
|
conn =
|
||||||
|
@ -84,12 +80,8 @@ defmodule FreediveWeb.UserConfirmationLiveTest do
|
||||||
|> render_submit()
|
|> render_submit()
|
||||||
|> follow_redirect(conn, ~p"/")
|
|> follow_redirect(conn, ~p"/")
|
||||||
|
|
||||||
# Home is now behind login page and only latest flash message is shown
|
|
||||||
assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
||||||
"You must log in to access this page."
|
"User confirmation link is invalid or it has expired"
|
||||||
|
|
||||||
# assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
|
||||||
# "User confirmation link is invalid or it has expired"
|
|
||||||
|
|
||||||
refute Accounts.get_user!(user.id).confirmed_at
|
refute Accounts.get_user!(user.id).confirmed_at
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue