From 6afc5d02b3fd4e9d17c4270995f7a4cc8f048cdf Mon Sep 17 00:00:00 2001 From: Alexander Don Date: Mon, 1 Sep 2025 20:44:17 +0300 Subject: [PATCH 1/3] updated the comments in users_live html file --- lib/phoenix_kit_web/live/users_live.html.heex | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/phoenix_kit_web/live/users_live.html.heex b/lib/phoenix_kit_web/live/users_live.html.heex index f2a7a2e2..e6d238ab 100644 --- a/lib/phoenix_kit_web/live/users_live.html.heex +++ b/lib/phoenix_kit_web/live/users_live.html.heex @@ -5,9 +5,9 @@ current_path={@current_path} >
- + <%!-- Header Section --%>
- + <%!-- Back Button (Left aligned) --%> <.link navigate="/phoenix_kit/admin/dashboard" class="btn btn-outline btn-primary btn-sm absolute left-0 top-0 -mb-12" @@ -23,15 +23,15 @@ Back to Dashboard - - + + <%!-- Title Section --%>

User Management

Manage user accounts and roles

- - + + <%!-- Role Management Modal --%> <%= if @show_role_modal && @managing_user do %> <% end %> - - + + <%!-- Controls --%>
- + <%!-- Search --%>
- - + + <%!-- Role Filter --%>
- - + + <%!-- Add User Button --%>
- - + + <%!-- Users Table --%>
<%= if length(@users) > 0 do %>
@@ -216,7 +216,7 @@
- + <%!-- Edit User --%> <.link navigate={"/phoenix_kit/admin/users/edit/#{user.id}"} class="btn btn-xs btn-outline btn-secondary" @@ -237,8 +237,8 @@ Edit - - + + <%!-- Role Management --%> <%= if user.id != @phoenix_kit_current_user.id do %>
- - + + <%!-- Pagination --%> <%= if @total_pages > 1 do %>
@@ -343,7 +343,7 @@
<% end %> <% else %> - + <%!-- Empty state --%>
<% end %>
- - + + <%!-- Enhanced Stats --%>

User Statistics

- - + + <%!-- Main Role Stats --%>
@@ -437,10 +437,10 @@
- - + + <%!-- Secondary Stats - Gradient Cards --%>
- + <%!-- Active Users --%>
@@ -456,8 +456,8 @@
Active Users
Online users
- - + + <%!-- Inactive Users --%>
@@ -473,8 +473,8 @@
Inactive Users
Disabled
- - + + <%!-- Confirmed Users --%>
@@ -492,8 +492,8 @@
Confirmed
Verified emails
- - + + <%!-- Pending Users --%>
From 818942305aa43f1f076faf5a54b478e7cbefdd8f Mon Sep 17 00:00:00 2001 From: Alexander Don Date: Mon, 1 Sep 2025 20:44:30 +0300 Subject: [PATCH 2/3] added Modules page in dashboard --- lib/phoenix_kit_web/components/admin_nav.ex | 9 +++++++++ lib/phoenix_kit_web/components/layout_wrapper.ex | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/lib/phoenix_kit_web/components/admin_nav.ex b/lib/phoenix_kit_web/components/admin_nav.ex index 6d145af6..dbed0f3f 100644 --- a/lib/phoenix_kit_web/components/admin_nav.ex +++ b/lib/phoenix_kit_web/components/admin_nav.ex @@ -112,6 +112,15 @@ defmodule PhoenixKitWeb.AdminNav do d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z" /> + <% "modules" -> %> + + + <% _ -> %> + + <.admin_nav_item + href="/phoenix_kit/admin/modules" + icon="modules" + label="Modules" + current_path={@current_path || ""} + /> From c96b8905fb768b943841e66b9ccb0c9dda7702ab Mon Sep 17 00:00:00 2001 From: Alexander Don Date: Mon, 1 Sep 2025 22:44:24 +0300 Subject: [PATCH 3/3] Added the Modules tab/page in admin dashboard --- .../components/layout_wrapper.ex | 22 ++++----- lib/phoenix_kit_web/integration.ex | 1 + lib/phoenix_kit_web/live/modules_live.ex | 20 ++++++++ .../live/modules_live.html.heex | 49 +++++++++++++++++++ 4 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 lib/phoenix_kit_web/live/modules_live.ex create mode 100644 lib/phoenix_kit_web/live/modules_live.html.heex diff --git a/lib/phoenix_kit_web/components/layout_wrapper.ex b/lib/phoenix_kit_web/components/layout_wrapper.ex index df46dd59..59483312 100644 --- a/lib/phoenix_kit_web/components/layout_wrapper.ex +++ b/lib/phoenix_kit_web/components/layout_wrapper.ex @@ -204,6 +204,13 @@ defmodule PhoenixKitWeb.Components.LayoutWrapper do current_path={@current_path || ""} /> + <.admin_nav_item + href="/phoenix_kit/admin/modules" + icon="modules" + label="Modules" + current_path={@current_path || ""} + /> +
@@ -224,13 +231,6 @@ defmodule PhoenixKitWeb.Components.LayoutWrapper do label="Roles" current_path={@current_path || ""} /> - - <.admin_nav_item - href="/phoenix_kit/admin/modules" - icon="modules" - label="Modules" - current_path={@current_path || ""} - /> @@ -269,14 +269,14 @@ defmodule PhoenixKitWeb.Components.LayoutWrapper do this.setTheme(savedTheme); this.setupListeners(); }, - + setTheme(theme) { document.documentElement.setAttribute('data-theme', theme); localStorage.setItem('phoenix_kit_theme', theme); - + // Update slider position via CSS data attribute document.documentElement.setAttribute('data-theme', theme); - + // Update active state for all theme buttons document.querySelectorAll('[data-theme-target]').forEach(btn => { if (btn.dataset.themeTarget === theme) { @@ -286,7 +286,7 @@ defmodule PhoenixKitWeb.Components.LayoutWrapper do } }); }, - + setupListeners() { // Listen to Phoenix LiveView theme events document.addEventListener('phx:set-admin-theme', (e) => { diff --git a/lib/phoenix_kit_web/integration.ex b/lib/phoenix_kit_web/integration.ex index 3ca00bd8..2d794bac 100644 --- a/lib/phoenix_kit_web/integration.ex +++ b/lib/phoenix_kit_web/integration.ex @@ -127,6 +127,7 @@ defmodule PhoenixKitWeb.Integration do live "/admin/users/new", Users.UserFormLive, :new live "/admin/users/edit/:id", Users.UserFormLive, :edit live "/admin/roles", Live.RolesLive, :index + live "/admin/modules", Live.ModulesLive, :index end end end diff --git a/lib/phoenix_kit_web/live/modules_live.ex b/lib/phoenix_kit_web/live/modules_live.ex new file mode 100644 index 00000000..e5c4edbe --- /dev/null +++ b/lib/phoenix_kit_web/live/modules_live.ex @@ -0,0 +1,20 @@ +defmodule PhoenixKitWeb.Live.ModulesLive do + use PhoenixKitWeb, :live_view + + def mount(_params, session, socket) do + # Get current path for navigation + current_path = get_current_path(socket, session) + + socket = + socket + |> assign(:current_path, current_path) + |> assign(:page_title, "Modules") + + {:ok, socket} + end + + defp get_current_path(_socket, _session) do + # For ModulesLive, always return modules path + "/phoenix_kit/admin/modules" + end +end \ No newline at end of file diff --git a/lib/phoenix_kit_web/live/modules_live.html.heex b/lib/phoenix_kit_web/live/modules_live.html.heex new file mode 100644 index 00000000..3fd47b3d --- /dev/null +++ b/lib/phoenix_kit_web/live/modules_live.html.heex @@ -0,0 +1,49 @@ + +
+ +
+ + <.link + navigate="/phoenix_kit/admin/dashboard" + class="btn btn-outline btn-primary btn-sm absolute left-0 top-0 -mb-12" + > + + + + Back to Dashboard + + + +
+

Modules Management

+

Manage system modules and extensions

+
+
+ +
+
+

Available Modules

+
+
🧩
+

+ Module System Coming Soon +

+

+ This section will allow you to manage and configure system modules, + extensions, and integrations for your PhoenixKit application. +

+
+
+
+
+
\ No newline at end of file