From b2fe3edb2e179706fc2ea38d20c112a199f89e1c Mon Sep 17 00:00:00 2001 From: Thibaud Chauviere Date: Thu, 18 Feb 2016 11:35:55 +0100 Subject: [PATCH 1/3] // Added material icons on module page header toolbar --- .../Controller/Admin/ModuleController.php | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/PrestaShopBundle/Controller/Admin/ModuleController.php b/src/PrestaShopBundle/Controller/Admin/ModuleController.php index 0489934697542..ef6e959bb2009 100755 --- a/src/PrestaShopBundle/Controller/Admin/ModuleController.php +++ b/src/PrestaShopBundle/Controller/Admin/ModuleController.php @@ -211,7 +211,6 @@ public function getPreferredModulesAction() */ public function importModuleAction(Request $request) { - try { $file_uploaded = $request->files->get('file_uploaded'); $file_uploaded_name = $file_uploaded->getClientOriginalName(); @@ -294,28 +293,10 @@ protected function getToolbarButtons() // toolbarButtons $toolbarButtons = array(); - $toolbarButtons['catalog_module'] = array( - 'href' => $this->generateUrl('admin_module_catalog'), - 'desc' => $translator->trans('[TEMP] Modules catalog', array(), get_class($this)), - 'icon' => 'icon-share-square', - 'help' => $translator->trans('Catalog', array(), get_class($this)), - ); - $toolbarButtons['manage_module'] = array( - 'href' => $this->generateUrl('admin_module_manage'), - 'desc' => $translator->trans('[TEMP] Manage my modules', array(), get_class($this)), - 'icon' => 'icon-share-square', - 'help' => $translator->trans('Manage', array(), get_class($this)), - ); - $toolbarButtons['notifications_module'] = array( - 'href' => $this->generateUrl('admin_module_notification'), - 'desc' => $translator->trans('[TEMP] Module notifications', array(), get_class($this)), - 'icon' => 'icon-share-square', - 'help' => $translator->trans('Notifications', array(), get_class($this)), - ); $toolbarButtons['add_module'] = array( 'href' => '#', 'desc' => $translator->trans('Add a module', array(), get_class($this)), - 'icon' => 'process-icon-new', + 'icon' => 'cloud_upload', 'help' => $translator->trans('Add a module', array(), get_class($this)), ); $toolbarButtons['addons_connect'] = $this->getAddonsConnectToolbar(); @@ -505,14 +486,14 @@ final private function getAddonsConnectToolbar() $addonsConnect = [ 'href' => $this->generateUrl('admin_addons_logout'), 'desc' => $addonsEmail['username_addons'], - 'icon' => 'icon-chain-broken', + 'icon' => 'exit_to_app', 'help' => $translator->trans('Synchronized with Addons Marketplace!', array(), get_class($this)) ]; } else { $addonsConnect = [ 'href' => '#', 'desc' => $translator->trans('Connect to addons marketplace', array(), get_class($this)), - 'icon' => 'icon-chain-broken', + 'icon' => 'vpn_key', 'help' => $translator->trans('Connect to addons marketplace', array(), get_class($this)) ]; } From be8c445ef12fd8efc09d14c3c6b56e652cebd2e5 Mon Sep 17 00:00:00 2001 From: Thibaud Chauviere Date: Thu, 18 Feb 2016 16:46:13 +0100 Subject: [PATCH 2/3] =?UTF-8?q?//=20Added=20m=C3=B9issing=20data=20attribu?= =?UTF-8?q?te=20on=20modal=5Fconfirm=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Admin/Module/_partials/_modules_modal_confirm.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PrestaShopBundle/Resources/views/Admin/Module/_partials/_modules_modal_confirm.html.twig b/src/PrestaShopBundle/Resources/views/Admin/Module/_partials/_modules_modal_confirm.html.twig index 1287d93bf2c5b..62634260442ed 100644 --- a/src/PrestaShopBundle/Resources/views/Admin/Module/_partials/_modules_modal_confirm.html.twig +++ b/src/PrestaShopBundle/Resources/views/Admin/Module/_partials/_modules_modal_confirm.html.twig @@ -51,17 +51,19 @@ From c6615e20bbeefca1db07c08658fd1c5f9e59df34 Mon Sep 17 00:00:00 2001 From: Thibaud Chauviere Date: Thu, 18 Feb 2016 16:47:56 +0100 Subject: [PATCH 3/3] // Coding standards fixes on module page javascript files --- admin-dev/themes/default/js/bundle/module/module.js | 2 +- admin-dev/themes/default/js/bundle/module/module_card.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/default/js/bundle/module/module.js b/admin-dev/themes/default/js/bundle/module/module.js index c103454b9a8dd..7776aa11eed25 100644 --- a/admin-dev/themes/default/js/bundle/module/module.js +++ b/admin-dev/themes/default/js/bundle/module/module.js @@ -120,7 +120,7 @@ var AdminModule = function () { dataType: 'json', data: $(this).serialize(), beforeSend: function() { - $(_that.addonsLoginButtonSelector).show() + $(_that.addonsLoginButtonSelector).show(); $("button.btn[type='submit']", _that.addonsConnectForm).hide(); } }).done(function (response) { diff --git a/admin-dev/themes/default/js/bundle/module/module_card.js b/admin-dev/themes/default/js/bundle/module/module_card.js index 244de3411028f..f7049d866f4e4 100644 --- a/admin-dev/themes/default/js/bundle/module/module_card.js +++ b/admin-dev/themes/default/js/bundle/module/module_card.js @@ -43,7 +43,6 @@ var AdminModuleCard = function () { return true; } modal.first().modal('show'); - ; return false; // do not allow a.href to reload the page. The confirm modal dialog will do it async if needed. }; var dispatchPreEvent = function (action, element) { @@ -100,7 +99,7 @@ var AdminModuleCard = function () { $.growl.error({message: "No answer received from server"}); } else { var moduleTechName = Object.keys(result)[0]; - if (result[moduleTechName].status == false) { + if (result[moduleTechName].status === false) { $.growl.error({message: result[moduleTechName].msg}); } else { $.growl.notice({message: result[moduleTechName].msg});