add placeholder admin page

This commit is contained in:
sloane 2025-02-22 07:17:51 -05:00
parent dee1bef5bf
commit 56730540b7
Signed by: sloanelybutsurely
SSH key fingerprint: SHA256:8SBnwhl+RY3oEyQxy1a9wByPzxWM0x+/Ejc+sIlY5qQ
4 changed files with 42 additions and 1 deletions

View 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>

View file

@ -8,7 +8,7 @@
</ul>
</nav>
</section>
<main>
<main class="p-2">
{@inner_content}
</main>
</div>

View 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

View file

@ -1,4 +1,5 @@
defmodule CMSWeb.Router do
alias CMSWeb.Layouts
use CMSWeb, :router
pipeline :browser do
@ -22,6 +23,14 @@ defmodule CMSWeb.Router do
get "/microblog", PageController, :microblog
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.
# scope "/api", CMSWeb do
# pipe_through :api