add placeholder admin page
This commit is contained in:
parent
dee1bef5bf
commit
56730540b7
4 changed files with 42 additions and 1 deletions
lib/cms_web
17
lib/cms_web/components/layouts/admin.html.heex
Normal file
17
lib/cms_web/components/layouts/admin.html.heex
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<div class="flex flex-row py-1 px-3 mb-2 border-b border-slate-100">
|
||||||
|
admin mode
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col md:flex-row mx-auto max-w-3xl">
|
||||||
|
<section class="flex flex-col p-2 gap-y-1 border-slate-100 border-b md:border-b-0">
|
||||||
|
<.link navigate={~p"/"} class="font-bold hover:underline">sloanelybutsurely.com</.link>
|
||||||
|
<nav>
|
||||||
|
<ul>
|
||||||
|
<li><.link navigate={~p"/writing"} class="hover:underline">writing</.link></li>
|
||||||
|
<li><.link navigate={~p"/microblog"} class="hover:underline">microblog</.link></li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</section>
|
||||||
|
<main class="p-2">
|
||||||
|
{@inner_content}
|
||||||
|
</main>
|
||||||
|
</div>
|
|
@ -8,7 +8,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</section>
|
</section>
|
||||||
<main>
|
<main class="p-2">
|
||||||
{@inner_content}
|
{@inner_content}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
15
lib/cms_web/live/admin_live.ex
Normal file
15
lib/cms_web/live/admin_live.ex
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
defmodule CMSWeb.AdminLive do
|
||||||
|
use CMSWeb, :live_view
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def mount(_params, _session, socket) do
|
||||||
|
{:ok, socket}
|
||||||
|
end
|
||||||
|
|
||||||
|
@impl true
|
||||||
|
def render(assigns) do
|
||||||
|
~H"""
|
||||||
|
<h1>AdminLive</h1>
|
||||||
|
"""
|
||||||
|
end
|
||||||
|
end
|
|
@ -1,4 +1,5 @@
|
||||||
defmodule CMSWeb.Router do
|
defmodule CMSWeb.Router do
|
||||||
|
alias CMSWeb.Layouts
|
||||||
use CMSWeb, :router
|
use CMSWeb, :router
|
||||||
|
|
||||||
pipeline :browser do
|
pipeline :browser do
|
||||||
|
@ -22,6 +23,14 @@ defmodule CMSWeb.Router do
|
||||||
get "/microblog", PageController, :microblog
|
get "/microblog", PageController, :microblog
|
||||||
end
|
end
|
||||||
|
|
||||||
|
live_session :admin, layout: {Layouts, :admin} do
|
||||||
|
scope "/admin", CMSWeb do
|
||||||
|
pipe_through :browser
|
||||||
|
|
||||||
|
live "/", AdminLive
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Other scopes may use custom stacks.
|
# Other scopes may use custom stacks.
|
||||||
# scope "/api", CMSWeb do
|
# scope "/api", CMSWeb do
|
||||||
# pipe_through :api
|
# pipe_through :api
|
||||||
|
|
Loading…
Reference in a new issue