feat(admin): add Platform Administration section to sidebar
Reorganized sidebar navigation: - Added "Platform Administration" section header below Dashboard - Grouped Companies, Vendors, Users, Customers, Marketplace under it - Added new Customers page (empty placeholder for future) - Changed Marketplace icon from shopping-bag to globe - Renamed "Marketplace Import" to "Marketplace" for brevity New files: - app/templates/admin/customers.html - Route: GET /admin/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,7 @@ Routes:
|
|||||||
- GET /vendor-themes → Vendor themes selection page (auth required)
|
- GET /vendor-themes → Vendor themes selection page (auth required)
|
||||||
- GET /vendors/{vendor_code}/theme → Vendor theme editor (auth required)
|
- GET /vendors/{vendor_code}/theme → Vendor theme editor (auth required)
|
||||||
- GET /users → User management page (auth required)
|
- GET /users → User management page (auth required)
|
||||||
|
- GET /customers → Customer management page (auth required)
|
||||||
- GET /imports → Import history page (auth required)
|
- GET /imports → Import history page (auth required)
|
||||||
- GET /settings → Settings page (auth required)
|
- GET /settings → Settings page (auth required)
|
||||||
- GET /platform-homepage → Platform homepage manager (auth required)
|
- GET /platform-homepage → Platform homepage manager (auth required)
|
||||||
@@ -449,6 +450,30 @@ async def admin_user_edit_page(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# ============================================================================
|
||||||
|
# CUSTOMER MANAGEMENT ROUTES
|
||||||
|
# ============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/customers", response_class=HTMLResponse, include_in_schema=False)
|
||||||
|
async def admin_customers_page(
|
||||||
|
request: Request,
|
||||||
|
current_user: User = Depends(get_current_admin_from_cookie_or_header),
|
||||||
|
db: Session = Depends(get_db),
|
||||||
|
):
|
||||||
|
"""
|
||||||
|
Render customers management page.
|
||||||
|
Shows list of all platform customers.
|
||||||
|
"""
|
||||||
|
return templates.TemplateResponse(
|
||||||
|
"admin/customers.html",
|
||||||
|
{
|
||||||
|
"request": request,
|
||||||
|
"user": current_user,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# IMPORT MANAGEMENT ROUTES
|
# IMPORT MANAGEMENT ROUTES
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
|
|||||||
51
app/templates/admin/customers.html
Normal file
51
app/templates/admin/customers.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{# app/templates/admin/customers.html #}
|
||||||
|
{% extends "admin/base.html" %}
|
||||||
|
|
||||||
|
{% block title %}Customers{% endblock %}
|
||||||
|
|
||||||
|
{% block alpine_data %}adminCustomers(){% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<!-- Page Header -->
|
||||||
|
<div class="flex items-center justify-between my-6">
|
||||||
|
<div>
|
||||||
|
<h2 class="text-2xl font-semibold text-gray-700 dark:text-gray-200">
|
||||||
|
Customers
|
||||||
|
</h2>
|
||||||
|
<p class="text-sm text-gray-600 dark:text-gray-400 mt-1">
|
||||||
|
Manage platform customers
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Empty State -->
|
||||||
|
<div class="px-4 py-12 bg-white rounded-lg shadow-md dark:bg-gray-800">
|
||||||
|
<div class="text-center">
|
||||||
|
<span x-html="$icon('user-group', 'mx-auto h-12 w-12 text-gray-400')"></span>
|
||||||
|
<h3 class="mt-4 text-lg font-medium text-gray-900 dark:text-gray-100">
|
||||||
|
Customers Management
|
||||||
|
</h3>
|
||||||
|
<p class="mt-2 text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
Customer management features coming soon.
|
||||||
|
</p>
|
||||||
|
<p class="mt-1 text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
This section will allow you to view and manage customers across all vendors.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block extra_scripts %}
|
||||||
|
<script>
|
||||||
|
function adminCustomers() {
|
||||||
|
return {
|
||||||
|
...data(),
|
||||||
|
currentPage: 'customers',
|
||||||
|
|
||||||
|
init() {
|
||||||
|
console.log('Customers page initialized');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
@@ -18,8 +18,14 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Main Navigation -->
|
<!-- Platform Administration Section -->
|
||||||
<ul>
|
<div class="px-6 my-6">
|
||||||
|
<hr class="border-gray-200 dark:border-gray-700" />
|
||||||
|
</div>
|
||||||
|
<p class="px-6 text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
|
||||||
|
Platform Administration
|
||||||
|
</p>
|
||||||
|
<ul class="mt-3">
|
||||||
<!-- Companies -->
|
<!-- Companies -->
|
||||||
<li class="relative px-6 py-3">
|
<li class="relative px-6 py-3">
|
||||||
<span x-show="currentPage === 'companies'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
<span x-show="currentPage === 'companies'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||||
@@ -53,14 +59,25 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Marketplace Import -->
|
<!-- Customers -->
|
||||||
|
<li class="relative px-6 py-3">
|
||||||
|
<span x-show="currentPage === 'customers'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||||
|
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||||
|
:class="currentPage === 'customers' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||||
|
href="/admin/customers">
|
||||||
|
<span x-html="$icon('user-group')"></span>
|
||||||
|
<span class="ml-4">Customers</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- Marketplace -->
|
||||||
<li class="relative px-6 py-3">
|
<li class="relative px-6 py-3">
|
||||||
<span x-show="currentPage === 'marketplace'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
<span x-show="currentPage === 'marketplace'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||||
:class="currentPage === 'marketplace' ? 'text-gray-800 dark:text-gray-100' : ''"
|
:class="currentPage === 'marketplace' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||||
href="/admin/marketplace">
|
href="/admin/marketplace">
|
||||||
<span x-html="$icon('shopping-bag')"></span>
|
<span x-html="$icon('globe')"></span>
|
||||||
<span class="ml-4">Marketplace Import</span>
|
<span class="ml-4">Marketplace</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -247,8 +264,14 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<!-- Main Navigation -->
|
<!-- Platform Administration Section -->
|
||||||
<ul>
|
<div class="px-6 my-6">
|
||||||
|
<hr class="border-gray-200 dark:border-gray-700" />
|
||||||
|
</div>
|
||||||
|
<p class="px-6 text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
|
||||||
|
Platform Administration
|
||||||
|
</p>
|
||||||
|
<ul class="mt-3">
|
||||||
<!-- Companies -->
|
<!-- Companies -->
|
||||||
<li class="relative px-6 py-3">
|
<li class="relative px-6 py-3">
|
||||||
<span x-show="currentPage === 'companies'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
<span x-show="currentPage === 'companies'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||||
@@ -282,14 +305,25 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<!-- Marketplace Import -->
|
<!-- Customers -->
|
||||||
|
<li class="relative px-6 py-3">
|
||||||
|
<span x-show="currentPage === 'customers'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||||
|
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||||
|
:class="currentPage === 'customers' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||||
|
href="/admin/customers">
|
||||||
|
<span x-html="$icon('user-group')"></span>
|
||||||
|
<span class="ml-4">Customers</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<!-- Marketplace -->
|
||||||
<li class="relative px-6 py-3">
|
<li class="relative px-6 py-3">
|
||||||
<span x-show="currentPage === 'marketplace'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
<span x-show="currentPage === 'marketplace'" class="absolute inset-y-0 left-0 w-1 bg-purple-600 rounded-tr-lg rounded-br-lg" aria-hidden="true"></span>
|
||||||
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
<a class="inline-flex items-center w-full text-sm font-semibold transition-colors duration-150 hover:text-gray-800 dark:hover:text-gray-200"
|
||||||
:class="currentPage === 'marketplace' ? 'text-gray-800 dark:text-gray-100' : ''"
|
:class="currentPage === 'marketplace' ? 'text-gray-800 dark:text-gray-100' : ''"
|
||||||
href="/admin/marketplace">
|
href="/admin/marketplace">
|
||||||
<span x-html="$icon('shopping-bag')"></span>
|
<span x-html="$icon('globe')"></span>
|
||||||
<span class="ml-4">Marketplace Import</span>
|
<span class="ml-4">Marketplace</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user