From c7b73b4e4134e568786a020c7e850cd4c98bdc5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 21 Feb 2018 12:52:26 -0500 Subject: [PATCH] closes #6337 --- src/controllers/admin/plugins.js | 13 ++++++++++--- src/views/admin/extend/plugins.tpl | 15 ++++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/controllers/admin/plugins.js b/src/controllers/admin/plugins.js index b04458edae..b5863e7c9e 100644 --- a/src/controllers/admin/plugins.js +++ b/src/controllers/admin/plugins.js @@ -33,11 +33,18 @@ pluginsController.get = function (req, res, next) { var compatiblePkgNames = payload.compatible.map(function (pkgData) { return pkgData.name; }); + var installedPlugins = payload.compatible.filter(function (plugin) { + return plugin && plugin.installed; + }); + var activePlugins = payload.all.filter(function (plugin) { + return plugin && plugin.installed && plugin.active; + }); res.render('admin/extend/plugins', { - installed: payload.compatible.filter(function (plugin) { - return plugin.installed; - }), + installed: installedPlugins, + installedCount: installedPlugins.length, + activeCount: activePlugins.length, + inactiveCount: Math.max(0, installedPlugins.length - activePlugins.length), upgradeCount: payload.compatible.reduce(function (count, current) { if (current.installed && current.outdated) { count += 1; diff --git a/src/views/admin/extend/plugins.tpl b/src/views/admin/extend/plugins.tpl index 7afffd5e08..cbf44febf8 100644 --- a/src/views/admin/extend/plugins.tpl +++ b/src/views/admin/extend/plugins.tpl @@ -1,7 +1,16 @@