add book route
This commit is contained in:
parent
eee6f60141
commit
7bf98f3a05
5 changed files with 34 additions and 71 deletions
|
@ -1,31 +1,5 @@
|
||||||
<header class="px-4 sm:px-6 lg:px-8">
|
|
||||||
<div class="flex items-center justify-between border-b border-zinc-100 py-3 text-sm">
|
|
||||||
<div class="flex items-center gap-4">
|
|
||||||
<a href="/">
|
|
||||||
<img src={~p"/images/logo.svg"} width="36" />
|
|
||||||
</a>
|
|
||||||
<p class="bg-brand/5 text-brand rounded-full px-2 font-medium leading-6">
|
|
||||||
v{Application.spec(:phoenix, :vsn)}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-4 font-semibold leading-6 text-zinc-900">
|
|
||||||
<a href="https://twitter.com/elixirphoenix" class="hover:text-zinc-700">
|
|
||||||
@elixirphoenix
|
|
||||||
</a>
|
|
||||||
<a href="https://github.com/phoenixframework/phoenix" class="hover:text-zinc-700">
|
|
||||||
GitHub
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
href="https://hexdocs.pm/phoenix/overview.html"
|
|
||||||
class="rounded-lg bg-zinc-100 px-2 py-1 hover:bg-zinc-200/80"
|
|
||||||
>
|
|
||||||
Get Started <span aria-hidden="true">→</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<main class="px-4 py-20 sm:px-6 lg:px-8">
|
<main class="px-4 py-20 sm:px-6 lg:px-8">
|
||||||
<div class="mx-auto max-w-2xl">
|
<div class="mx-auto max-w-6xl">
|
||||||
<.flash_group flash={@flash} />
|
<.flash_group flash={@flash} />
|
||||||
{@inner_content}
|
{@inner_content}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,55 +4,38 @@
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="csrf-token" content={get_csrf_token()} />
|
<meta name="csrf-token" content={get_csrf_token()} />
|
||||||
<.live_title default="Call of the Wild" suffix="">
|
<.live_title default="BookSocial" suffix="">
|
||||||
{assigns[:page_title]}
|
{assigns[:page_title]}
|
||||||
</.live_title>
|
</.live_title>
|
||||||
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
|
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />
|
||||||
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"}>
|
<script defer phx-track-static type="text/javascript" src={~p"/assets/app.js"} />
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-white">
|
<body class="bg-white">
|
||||||
<ul class="relative z-10 flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end">
|
<nav class="py-2">
|
||||||
|
<ul class="relative flex items-center gap-4 px-4 sm:px-6 lg:px-8 justify-end font-semibold text-sm text-zinc-900">
|
||||||
<%= if @current_user do %>
|
<%= if @current_user do %>
|
||||||
<li class="text-[0.8125rem] leading-6 text-zinc-900">
|
<li class="">
|
||||||
{@current_user.email}
|
{@current_user.email}
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<.link
|
<.link href={~p"/account/settings"} class="hover:text-zinc-600">
|
||||||
href={~p"/account/settings"}
|
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
|
||||||
>
|
|
||||||
Settings
|
Settings
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<.link
|
|
||||||
href={~p"/account/log_out"}
|
|
||||||
method="delete"
|
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
|
||||||
>
|
|
||||||
Log out
|
|
||||||
</.link>
|
|
||||||
</li>
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<li>
|
<li>
|
||||||
<.link
|
<.link href={~p"/account/log_in"} class="hover:text-zinc-600">
|
||||||
href={~p"/account/register"}
|
Log in
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
|
||||||
>
|
|
||||||
Register
|
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<.link
|
<.link href={~p"/account/register"} class="hover:text-zinc-600">
|
||||||
href={~p"/account/log_in"}
|
Sign up
|
||||||
class="text-[0.8125rem] leading-6 text-zinc-900 font-semibold hover:text-zinc-700"
|
|
||||||
>
|
|
||||||
Log in
|
|
||||||
</.link>
|
</.link>
|
||||||
</li>
|
</li>
|
||||||
<% end %>
|
<% end %>
|
||||||
</ul>
|
</ul>
|
||||||
|
</nav>
|
||||||
{@inner_content}
|
{@inner_content}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
3
lib/wild_web/live/books.ex
Normal file
3
lib/wild_web/live/books.ex
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
defmodule WildWeb.Books do
|
||||||
|
use WildWeb, :live_view
|
||||||
|
end
|
1
lib/wild_web/live/books.html.heex
Normal file
1
lib/wild_web/live/books.html.heex
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<div>Books</div>
|
|
@ -81,6 +81,8 @@ defmodule WildWeb.Router do
|
||||||
live "/account/confirm/:token", UserConfirmationLive, :edit
|
live "/account/confirm/:token", UserConfirmationLive, :edit
|
||||||
live "/account/confirm", UserConfirmationInstructionsLive, :new
|
live "/account/confirm", UserConfirmationInstructionsLive, :new
|
||||||
live "/", Index
|
live "/", Index
|
||||||
|
# live "/books/thoughts", BookReads, :thoughts
|
||||||
|
live "/books", Books
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue