phase 1 partial
This commit is contained in:
@@ -23,57 +23,42 @@ class Igny8AdminSite(admin.AdminSite):
|
||||
|
||||
def get_app_list(self, request):
|
||||
"""
|
||||
Customize the app list to organize models into proper groups
|
||||
Customize the app list to organize models into logical groups
|
||||
"""
|
||||
# Get the default app list
|
||||
app_dict = self._build_app_dict(request)
|
||||
|
||||
# Define our custom groups with their models (using object_name)
|
||||
# Organized by business function with emoji icons for visual recognition
|
||||
custom_groups = {
|
||||
'Billing & Tenancy': {
|
||||
'💰 Billing & Accounts': {
|
||||
'models': [
|
||||
('igny8_core_auth', 'Plan'),
|
||||
('igny8_core_auth', 'Account'),
|
||||
('igny8_core_auth', 'Subscription'),
|
||||
('billing', 'CreditTransaction'),
|
||||
('billing', 'CreditUsageLog'),
|
||||
('billing', 'Invoice'),
|
||||
('billing', 'Payment'),
|
||||
('billing', 'CreditTransaction'),
|
||||
('billing', 'CreditUsageLog'),
|
||||
('billing', 'CreditPackage'),
|
||||
('billing', 'PaymentMethodConfig'),
|
||||
('billing', 'AccountPaymentMethod'),
|
||||
('billing', 'CreditCostConfig'),
|
||||
],
|
||||
},
|
||||
'Sites & Users': {
|
||||
'👥 Sites & Users': {
|
||||
'models': [
|
||||
('igny8_core_auth', 'Site'),
|
||||
('igny8_core_auth', 'Sector'),
|
||||
('igny8_core_auth', 'User'),
|
||||
('igny8_core_auth', 'SiteUserAccess'),
|
||||
('igny8_core_auth', 'PasswordResetToken'),
|
||||
('igny8_core_auth', 'Sector'),
|
||||
],
|
||||
},
|
||||
'Global Reference Data': {
|
||||
'📚 Content Management': {
|
||||
'models': [
|
||||
('igny8_core_auth', 'Industry'),
|
||||
('igny8_core_auth', 'IndustrySector'),
|
||||
('igny8_core_auth', 'SeedKeyword'),
|
||||
('site_building', 'BusinessType'),
|
||||
('site_building', 'AudienceProfile'),
|
||||
('site_building', 'BrandPersonality'),
|
||||
('site_building', 'HeroImageryDirection'),
|
||||
],
|
||||
},
|
||||
'Planner': {
|
||||
'models': [
|
||||
('planner', 'Keywords'),
|
||||
('planner', 'Clusters'),
|
||||
('planner', 'ContentIdeas'),
|
||||
],
|
||||
},
|
||||
'Writer Module': {
|
||||
'models': [
|
||||
('writer', 'Tasks'),
|
||||
('writer', 'Content'),
|
||||
('writer', 'Tasks'),
|
||||
('writer', 'Images'),
|
||||
('writer', 'ContentTaxonomy'),
|
||||
('writer', 'ContentAttribute'),
|
||||
@@ -81,54 +66,53 @@ class Igny8AdminSite(admin.AdminSite):
|
||||
('writer', 'ContentClusterMap'),
|
||||
],
|
||||
},
|
||||
'Thinker Module': {
|
||||
'🎯 Planning & Strategy': {
|
||||
'models': [
|
||||
('system', 'AIPrompt'),
|
||||
('system', 'AuthorProfile'),
|
||||
('planner', 'Clusters'),
|
||||
('planner', 'Keywords'),
|
||||
('planner', 'ContentIdeas'),
|
||||
('system', 'Strategy'),
|
||||
('ai', 'AITaskLog'),
|
||||
],
|
||||
},
|
||||
'System Configuration': {
|
||||
'🔗 Integrations & Publishing': {
|
||||
'models': [
|
||||
('integration', 'SiteIntegration'),
|
||||
('integration', 'SyncEvent'),
|
||||
('publishing', 'PublishingRecord'),
|
||||
('publishing', 'DeploymentRecord'),
|
||||
],
|
||||
},
|
||||
'🤖 AI & Automation': {
|
||||
'models': [
|
||||
('ai', 'AITaskLog'),
|
||||
('system', 'AIPrompt'),
|
||||
('automation', 'AutomationConfig'),
|
||||
('automation', 'AutomationRun'),
|
||||
('optimization', 'OptimizationTask'),
|
||||
],
|
||||
},
|
||||
'🌍 Global Reference Data': {
|
||||
'models': [
|
||||
('igny8_core_auth', 'Industry'),
|
||||
('igny8_core_auth', 'IndustrySector'),
|
||||
('igny8_core_auth', 'SeedKeyword'),
|
||||
],
|
||||
},
|
||||
'⚙️ System Configuration': {
|
||||
'models': [
|
||||
('system', 'IntegrationSettings'),
|
||||
('system', 'SystemLog'),
|
||||
('system', 'SystemStatus'),
|
||||
('system', 'AuthorProfile'),
|
||||
('system', 'SystemSettings'),
|
||||
('system', 'AccountSettings'),
|
||||
('system', 'UserSettings'),
|
||||
('system', 'ModuleSettings'),
|
||||
('system', 'AISettings'),
|
||||
('system', 'ModuleEnableSettings'),
|
||||
# Automation config lives under the automation app - include here
|
||||
('automation', 'AutomationConfig'),
|
||||
('automation', 'AutomationRun'),
|
||||
('system', 'SystemLog'),
|
||||
('system', 'SystemStatus'),
|
||||
],
|
||||
},
|
||||
'Payments': {
|
||||
'models': [
|
||||
('billing', 'PaymentMethodConfig'),
|
||||
('billing', 'AccountPaymentMethod'),
|
||||
],
|
||||
},
|
||||
'Integrations & Sync': {
|
||||
'models': [
|
||||
('integration', 'SiteIntegration'),
|
||||
('integration', 'SyncEvent'),
|
||||
],
|
||||
},
|
||||
'Publishing': {
|
||||
'models': [
|
||||
('publishing', 'PublishingRecord'),
|
||||
('publishing', 'DeploymentRecord'),
|
||||
],
|
||||
},
|
||||
'Optimization': {
|
||||
'models': [
|
||||
('optimization', 'OptimizationTask'),
|
||||
],
|
||||
},
|
||||
'Django Internals': {
|
||||
'🔧 Django System': {
|
||||
'models': [
|
||||
('admin', 'LogEntry'),
|
||||
('auth', 'Group'),
|
||||
@@ -159,7 +143,7 @@ class Igny8AdminSite(admin.AdminSite):
|
||||
if group_models:
|
||||
app_list.append({
|
||||
'name': group_name,
|
||||
'app_label': group_name.lower().replace(' ', '_').replace('&', ''),
|
||||
'app_label': group_name.lower().replace(' ', '_').replace('&', '').replace('emoji', ''),
|
||||
'app_url': None,
|
||||
'has_module_perms': True,
|
||||
'models': group_models,
|
||||
@@ -167,18 +151,15 @@ class Igny8AdminSite(admin.AdminSite):
|
||||
|
||||
# Sort the app list by our custom order
|
||||
order = [
|
||||
'Billing & Tenancy',
|
||||
'Sites & Users',
|
||||
'Global Reference Data',
|
||||
'Planner',
|
||||
'Writer Module',
|
||||
'Thinker Module',
|
||||
'System Configuration',
|
||||
'Payments',
|
||||
'Integrations & Sync',
|
||||
'Publishing',
|
||||
'Optimization',
|
||||
'Django Internals',
|
||||
'💰 Billing & Accounts',
|
||||
'👥 Sites & Users',
|
||||
'📚 Content Management',
|
||||
'🎯 Planning & Strategy',
|
||||
'🔗 Integrations & Publishing',
|
||||
'🤖 AI & Automation',
|
||||
'🌍 Global Reference Data',
|
||||
'⚙️ System Configuration',
|
||||
'🔧 Django System',
|
||||
]
|
||||
|
||||
app_list.sort(key=lambda x: order.index(x['name']) if x['name'] in order else 999)
|
||||
|
||||
Reference in New Issue
Block a user