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 || ""} + /> + @@ -262,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) { @@ -279,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 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 %> @@ -90,11 +90,11 @@ <% end %> - - + + <%!-- Controls --%> - + <%!-- Search --%> Search by email or name @@ -109,8 +109,8 @@ /> - - + + <%!-- Role Filter --%> Filter by role @@ -124,8 +124,8 @@ - - + + <%!-- Add User Button --%> Quick Actions @@ -147,8 +147,8 @@ - - + + <%!-- 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 %> <% end %> - - + + <%!-- Status Toggle --%> <%= if user.id != @phoenix_kit_current_user.id && user_primary_role(user) != "Owner" 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 --%>
Manage system modules and extensions
+ This section will allow you to manage and configure system modules, + extensions, and integrations for your PhoenixKit application. +
Manage user accounts and roles