From e0a218ae76fb376cc7a05f62fe7a999436ca9b40 Mon Sep 17 00:00:00 2001 From: usmannasir Date: Tue, 1 Apr 2025 15:25:17 +0500 Subject: [PATCH] additional setting for improved wp page --- .../websiteFunctions/WPsitesList.html | 19 +++++++++++++++---- websiteFunctions/website.py | 17 ++++++++++++++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/websiteFunctions/templates/websiteFunctions/WPsitesList.html b/websiteFunctions/templates/websiteFunctions/WPsitesList.html index 263fb2ff0..20f538462 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsitesList.html +++ b/websiteFunctions/templates/websiteFunctions/WPsitesList.html @@ -304,13 +304,24 @@ -
+
+ {% if debug_info %} +
+

Debug Information

+

Total WordPress Sites: {{ total_sites }}

+

User ID: {{ debug_info.user_id }}

+

Is Admin: {{ debug_info.is_admin }}

+

WP Sites Count: {{ debug_info.wp_sites_count }}

+
+ {% endif %} + {% if not wpsite %}
No WordPress sites found. Install WordPress to get started.
{% endif %} + {% if wpsite %}

WordPress Toolkit {% if help_url %}Help{% endif %}

@@ -331,7 +342,7 @@ Manage -
@@ -593,9 +604,9 @@ } }); - function DeleteWPNow(url) { + function DeleteWPNow(baseUrl, siteId) { if (confirm('Are you sure you want to delete this WordPress site? This action cannot be undone.')) { - window.location.href = url; + window.location.href = baseUrl + '?DeleteID=' + siteId; } } diff --git a/websiteFunctions/website.py b/websiteFunctions/website.py index a056861eb..b21a5ea27 100755 --- a/websiteFunctions/website.py +++ b/websiteFunctions/website.py @@ -142,7 +142,8 @@ class WebsiteManager: admin = Administrator.objects.get(pk=userID) data = {} - data['wp'] = ACLManager.GetALLWPObjects(currentACL, userID) + wp_sites = ACLManager.GetALLWPObjects(currentACL, userID) + data['wp'] = wp_sites try: if DeleteID != None: @@ -164,8 +165,18 @@ class WebsiteManager: 'production_status': True # You can modify this based on your needs }) - proc = httpProc(request, 'websiteFunctions/WPsitesList.html', - {"wpsite": sites}) + context = { + "wpsite": sites, + "status": 1, + "total_sites": len(sites), + "debug_info": { + "user_id": userID, + "is_admin": currentACL.get('admin', 0), + "wp_sites_count": wp_sites.count() + } + } + + proc = httpProc(request, 'websiteFunctions/WPsitesList.html', context) return proc.render() def WPHome(self, request=None, userID=None, WPid=None, DeleteID=None):