mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
additional setting for improved wp page
This commit is contained in:
@@ -13,13 +13,13 @@
|
|||||||
|
|
||||||
// Now add our controller to the module
|
// Now add our controller to the module
|
||||||
angular.module('CyberCP').controller('listWordPressSites', function($scope, $http) {
|
angular.module('CyberCP').controller('listWordPressSites', function($scope, $http) {
|
||||||
// Initialize scope variables
|
// Initialize scope variables with pre-serialized JSON
|
||||||
$scope.wpSites = JSON.parse('{{ wpsite|escapejs }}');
|
$scope.wpSites = {{ wpsite|safe }};
|
||||||
$scope.debug = JSON.parse('{{ debug_info|default:"false"|escapejs }}');
|
$scope.debug = {{ debug_info|safe }};
|
||||||
$scope.totalSites = parseInt('{{ total_sites|default:"0"|escapejs }}');
|
$scope.totalSites = {{ total_sites }};
|
||||||
$scope.userId = parseInt('{{ debug_info.user_id|default:"0"|escapejs }}');
|
$scope.userId = $scope.debug.user_id;
|
||||||
$scope.isAdmin = JSON.parse('{{ debug_info.is_admin|default:"false"|escapejs }}');
|
$scope.isAdmin = $scope.debug.is_admin;
|
||||||
$scope.wpSitesCount = parseInt('{{ debug_info.wp_sites_count|default:"0"|escapejs }}');
|
$scope.wpSitesCount = $scope.debug.wp_sites_count;
|
||||||
|
|
||||||
$scope.deleteWPSite = function(site) {
|
$scope.deleteWPSite = function(site) {
|
||||||
if (confirm('Are you sure you want to delete this WordPress site? This action cannot be undone.')) {
|
if (confirm('Are you sure you want to delete this WordPress site? This action cannot be undone.')) {
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ class WebsiteManager:
|
|||||||
return redirect(reverse('pricing'))
|
return redirect(reverse('pricing'))
|
||||||
|
|
||||||
def ListWPSites(self, request=None, userID=None, DeleteID=None):
|
def ListWPSites(self, request=None, userID=None, DeleteID=None):
|
||||||
|
import json
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
@@ -166,14 +167,14 @@ class WebsiteManager:
|
|||||||
})
|
})
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"wpsite": sites,
|
"wpsite": json.dumps(sites),
|
||||||
"status": 1,
|
"status": 1,
|
||||||
"total_sites": len(sites),
|
"total_sites": len(sites),
|
||||||
"debug_info": {
|
"debug_info": json.dumps({
|
||||||
"user_id": userID,
|
"user_id": userID,
|
||||||
"is_admin": currentACL.get('admin', 0),
|
"is_admin": bool(currentACL.get('admin', 0)),
|
||||||
"wp_sites_count": wp_sites.count()
|
"wp_sites_count": wp_sites.count()
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
proc = httpProc(request, 'websiteFunctions/WPsitesList.html', context)
|
proc = httpProc(request, 'websiteFunctions/WPsitesList.html', context)
|
||||||
|
|||||||
Reference in New Issue
Block a user