Compare commits
3 commits
6cbcd313ee
...
3a1060826f
Author | SHA1 | Date | |
---|---|---|---|
3a1060826f | |||
caaa5d0387 | |||
01e5bb7467 |
5 changed files with 45 additions and 27 deletions
|
@ -1,6 +1,6 @@
|
|||
<main class="container">
|
||||
<.flash_group flash={@flash} />
|
||||
<.navbar is-fixed-top>
|
||||
<.navbar is-fixed-top is-light>
|
||||
<.navbar_brand>
|
||||
<.navbar_item>
|
||||
<.title is-4>
|
||||
|
@ -12,7 +12,7 @@
|
|||
</.navbar_brand>
|
||||
|
||||
<.navbar_menu id="navbar_top">
|
||||
<%= if @current_user do %>
|
||||
<%!-- <%= if @current_user do %>
|
||||
<.navbar_start>
|
||||
<.navbar_item has-dropdown is-hoverable>
|
||||
<.navbar_link>
|
||||
|
@ -50,7 +50,7 @@
|
|||
</.navbar_dropdown>
|
||||
</.navbar_item>
|
||||
</.navbar_start>
|
||||
<% end %>
|
||||
<% end %> --%>
|
||||
|
||||
<.navbar_end>
|
||||
<%= if @current_user do %>
|
||||
|
@ -64,16 +64,16 @@
|
|||
</.navbar_link>
|
||||
|
||||
<.navbar_dropdown>
|
||||
<.navbar_item>
|
||||
<%!-- <.navbar_item>
|
||||
<.link>Software Updates</.link>
|
||||
</.navbar_item>
|
||||
<.navbar_divider />
|
||||
<.navbar_item>
|
||||
<.link>Packages</.link>
|
||||
</.navbar_item>
|
||||
<.navbar_item>
|
||||
<.link>Services</.link>
|
||||
</.navbar_item>
|
||||
</.navbar_item> --%>
|
||||
<.link href={~p"/services"} class="navbar-item">
|
||||
Services
|
||||
</.link>
|
||||
</.navbar_dropdown>
|
||||
</.navbar_item>
|
||||
<% end %>
|
||||
|
@ -84,22 +84,16 @@
|
|||
|
||||
<.navbar_dropdown>
|
||||
<%= if @current_user do %>
|
||||
<.navbar_item>
|
||||
<.link href={~p"/users/settings"}>
|
||||
<.link href={~p"/users/settings"} class="navbar-item">
|
||||
Settings
|
||||
</.link>
|
||||
</.navbar_item>
|
||||
<.navbar_item>
|
||||
<.link href={~p"/users/log_out"} method="delete">
|
||||
<.link href={~p"/users/log_out"} method="delete" class="navbar-item">
|
||||
Log out
|
||||
</.link>
|
||||
</.navbar_item>
|
||||
<% else %>
|
||||
<.navbar_item>
|
||||
<.link href={~p"/users/log_in"}>
|
||||
<.link href={~p"/users/log_in"} class="navbar-item">
|
||||
Log in
|
||||
</.link>
|
||||
</.navbar_item>
|
||||
<% end %>
|
||||
</.navbar_dropdown>
|
||||
</.navbar_item>
|
||||
|
|
15
lib/freedive_web/live/home_live.ex
Normal file
15
lib/freedive_web/live/home_live.ex
Normal file
|
@ -0,0 +1,15 @@
|
|||
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
|
||||
pipe_through :browser
|
||||
|
||||
get "/", PageController, :home
|
||||
# get "/", PageController, :home
|
||||
end
|
||||
|
||||
# Other scopes may use custom stacks.
|
||||
|
@ -68,6 +68,7 @@ defmodule FreediveWeb.Router do
|
|||
|
||||
live_session :require_authenticated_user,
|
||||
on_mount: [{FreediveWeb.UserAuth, :ensure_authenticated}] do
|
||||
live "/", HomeLive
|
||||
live "/users/settings", UserSettingsLive, :edit
|
||||
live "/users/settings/confirm_email/:token", UserSettingsLive, :confirm_email
|
||||
end
|
||||
|
|
|
@ -3,6 +3,6 @@ defmodule FreediveWeb.PageControllerTest do
|
|||
|
||||
test "GET /", %{conn: conn} do
|
||||
conn = get(conn, ~p"/")
|
||||
assert html_response(conn, 200) =~ "Under Construction"
|
||||
assert html_response(conn, 302) =~ "redirected"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,8 +51,12 @@ defmodule FreediveWeb.UserConfirmationLiveTest do
|
|||
|
||||
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) =~
|
||||
"User confirmation link is invalid or it has expired"
|
||||
"You must log in to access this page."
|
||||
|
||||
# assert Phoenix.Flash.get(conn.assigns.flash, :error) =~
|
||||
# "User confirmation link is invalid or it has expired"
|
||||
|
||||
# when logged in
|
||||
conn =
|
||||
|
@ -80,8 +84,12 @@ defmodule FreediveWeb.UserConfirmationLiveTest do
|
|||
|> render_submit()
|
||||
|> 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) =~
|
||||
"User confirmation link is invalid or it has expired"
|
||||
"You must log in to access this page."
|
||||
|
||||
# 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
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue