From d82f373bd2f1bf73ff2c16858873424a08a386ef Mon Sep 17 00:00:00 2001 From: Inhji Date: Sat, 1 Apr 2023 16:05:20 +0200 Subject: [PATCH] initial admin page --- lib/chiya_web/components/admin_components.ex | 8 -------- .../components/layouts/app.html.heex | 2 +- .../components/layouts/root_app.html.heex | 2 +- .../controllers/admin_html/home.html.heex | 20 ++++++++++++++++++- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/chiya_web/components/admin_components.ex b/lib/chiya_web/components/admin_components.ex index c5fdbdb..64f678e 100644 --- a/lib/chiya_web/components/admin_components.ex +++ b/lib/chiya_web/components/admin_components.ex @@ -102,14 +102,6 @@ defmodule ChiyaWeb.AdminComponents do <.icon name="hero-sun-mini" class="h-4 w-4" /> -
  • - <.link - href={~p"/user"} - class="text-xs leading-6 text-gray-100 font-semibold hover:text-gray-300" - > - Profile - -
  • <.link href={~p"/admin"} diff --git a/lib/chiya_web/components/layouts/app.html.heex b/lib/chiya_web/components/layouts/app.html.heex index 7dd5e54..a359e41 100644 --- a/lib/chiya_web/components/layouts/app.html.heex +++ b/lib/chiya_web/components/layouts/app.html.heex @@ -1,5 +1,5 @@
    -
    +
    <.link href={~p"/admin/notes"} diff --git a/lib/chiya_web/components/layouts/root_app.html.heex b/lib/chiya_web/components/layouts/root_app.html.heex index fdc13d9..52248b6 100644 --- a/lib/chiya_web/components/layouts/root_app.html.heex +++ b/lib/chiya_web/components/layouts/root_app.html.heex @@ -21,7 +21,7 @@ } - + <.admin_bar current_user={@current_user} /> <%= @inner_content %>
    diff --git a/lib/chiya_web/controllers/admin_html/home.html.heex b/lib/chiya_web/controllers/admin_html/home.html.heex index b49447f..d8310bb 100644 --- a/lib/chiya_web/controllers/admin_html/home.html.heex +++ b/lib/chiya_web/controllers/admin_html/home.html.heex @@ -1 +1,19 @@ -<.header>Admin +
    + +
    +

    Welcome back,

    +

    <%= @current_user.email %>

    +
    + <.link href={~p"/user"}> + <.button>Profile + +
    + +
    + + <.icon name="hero-document-plus" /> New Note + +
    \ No newline at end of file