From d6e197a1989ba904d948bb732dc5170e68d0d7da Mon Sep 17 00:00:00 2001 From: usmannasir Date: Thu, 22 May 2025 14:53:38 +0500 Subject: [PATCH] improved websites list --- .../websiteFunctions/websiteFunctions.js | 39 ++ .../websiteFunctions/listWebsites.html | 613 +++++++++--------- 2 files changed, 338 insertions(+), 314 deletions(-) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 807ee0cd1..68c8b171a 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -2371,6 +2371,14 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.currentPage = 1; $scope.recordsToShow = 10; + $scope.expandedSites = {}; + $scope.toggleSite = function(site) { + $scope.expandedSites[site.domain] = !$scope.expandedSites[site.domain]; + }; + $scope.isExpanded = function(domain) { + return !!$scope.expandedSites[domain]; + }; + // Initial fetch of websites $scope.getFurtherWebsitesFromDB = function () { $scope.loading = true; // Set loading to true when starting fetch @@ -2392,6 +2400,11 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.WebSitesList = JSON.parse(response.data.data); $scope.pagination = response.data.pagination; $("#listFail").hide(); + // Expand the first website by default + if ($scope.WebSitesList.length > 0) { + $scope.expandedSites = {}; + $scope.expandedSites[$scope.WebSitesList[0].domain] = true; + } } else { $("#listFail").fadeIn(); $scope.errorMessage = response.data.error_message; @@ -5510,6 +5523,14 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.currentPage = 1; $scope.recordsToShow = 10; + $scope.expandedSites = {}; + $scope.toggleSite = function(site) { + $scope.expandedSites[site.domain] = !$scope.expandedSites[site.domain]; + }; + $scope.isExpanded = function(domain) { + return !!$scope.expandedSites[domain]; + }; + // Initial fetch of websites $scope.getFurtherWebsitesFromDB = function () { $scope.loading = true; // Set loading to true when starting fetch @@ -5531,6 +5552,11 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.WebSitesList = JSON.parse(response.data.data); $scope.pagination = response.data.pagination; $("#listFail").hide(); + // Expand the first website by default + if ($scope.WebSitesList.length > 0) { + $scope.expandedSites = {}; + $scope.expandedSites[$scope.WebSitesList[0].domain] = true; + } } else { $("#listFail").fadeIn(); $scope.errorMessage = response.data.error_message; @@ -8996,6 +9022,14 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.currentPage = 1; $scope.recordsToShow = 10; + $scope.expandedSites = {}; + $scope.toggleSite = function(site) { + $scope.expandedSites[site.domain] = !$scope.expandedSites[site.domain]; + }; + $scope.isExpanded = function(domain) { + return !!$scope.expandedSites[domain]; + }; + // Initial fetch of websites $scope.getFurtherWebsitesFromDB = function () { $scope.loading = true; // Set loading to true when starting fetch @@ -9017,6 +9051,11 @@ app.controller('listWebsites', function ($scope, $http, $window) { $scope.WebSitesList = JSON.parse(response.data.data); $scope.pagination = response.data.pagination; $("#listFail").hide(); + // Expand the first website by default + if ($scope.WebSitesList.length > 0) { + $scope.expandedSites = {}; + $scope.expandedSites[$scope.WebSitesList[0].domain] = true; + } } else { $("#listFail").fadeIn(); $scope.errorMessage = response.data.error_message; diff --git a/websiteFunctions/templates/websiteFunctions/listWebsites.html b/websiteFunctions/templates/websiteFunctions/listWebsites.html index 4e09feade..793b5d4ca 100755 --- a/websiteFunctions/templates/websiteFunctions/listWebsites.html +++ b/websiteFunctions/templates/websiteFunctions/listWebsites.html @@ -81,192 +81,178 @@ -
-
-
- -
- - +
+
+
+ +
+
+

+ + {$ web.domain $} +

+
+ +
+
+
+
+ +
- -
-
- - -
-
- - -
- -
- -
+
+ +
- -
-
- - -
-
- - -
-
- - -
- + - - -
-
-
-
-
-
-
-

- - {$ wp.title $} - - - -

-
-
- - -
+
+ +
+
+ + +
+
+
+
+
+
+
+

+ + {$ wp.title $} + + + +

+
+
+ +
-
-
-
- {$ wp.title $} - +
+
+ +
+
+
+
+ + {$ wp.version || 'Loading...' $} + +
+
+
+
+ + {$ wp.phpVersion || 'Loading...' $} + +
+
+
+
+ + {$ wp.theme || 'Loading...' $} + +
+
+
+
+ + {$ wp.activePlugins || '0' $} active + +
-
-
-
-
- - {$ wp.version || 'Loading...' $} - -
+
+
+
+
-
-
- - {$ wp.phpVersion || 'Loading...' $} - -
-
-
-
- - {$ wp.theme || 'Loading...' $} - -
-
-
-
- - {$ wp.activePlugins || '0' $} active - -
+
+
-
-
-
- -
-
- -
+
+
+
-
-
- -
-
- -
+
+
@@ -276,145 +262,9 @@
- - - -
-

{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}

-
+
+
+

{% trans "Cannot list websites. Error message:" %} {$ errorMessage $}

@@ -437,4 +287,139 @@
+ + {% endblock %}