Skip to content

Commit

Permalink
Merge pull request PrestaShop#5046 from tchauviere/wip/module-page
Browse files Browse the repository at this point in the history
// UI and JS improvements on Module Page in BO
  • Loading branch information
Julien Martin committed Feb 19, 2016
2 parents 7d8ef07 + c6615e2 commit 53f0c94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 26 deletions.
2 changes: 1 addition & 1 deletion admin-dev/themes/default/js/bundle/module/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions admin-dev/themes/default/js/bundle/module/module_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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});
Expand Down
25 changes: 3 additions & 22 deletions src/PrestaShopBundle/Controller/Admin/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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))
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,19 @@
</div>
<div class="modal-footer">
<input type="button" class="btn btn-default uppercase" data-dismiss="modal" value="{{ trans("Cancel", {}, 'AdminTabs')|raw }}" />
{% if module_action == 'disable' %}
{% if module_action == 'disable' %}
<a class="btn btn-primary uppercase module_action_modal_{{ module_action }}" data-dismiss="modal"
data-tech-name="{{module.name}}"
href="{{ module_url }}">{{ trans("Yes, I want to disable", {}, 'AdminModules')|raw }}</a>
{% endif %}
{% if module_action == 'uninstall' %}
<a class="btn btn-primary uppercase module_action_modal_{{ module_action }}" data-dismiss="modal"
data-tech-name="{{module.name}}"
href="{{ module_url }}">{{ trans("Yes, I want to uninstall", {}, 'AdminModules')|raw }}</a>
{% endif %}
{% if module_action == 'reset' %}
<a class="btn btn-primary uppercase module_action_modal_{{ module_action }}" data-dismiss="modal"
data-tech-name="{{module.name}}"
href="{{ module_url }}">{{ trans("Yes, I want to reset", {}, 'AdminModules')|raw }}</a>
{% endif %}
</div>
Expand Down

0 comments on commit 53f0c94

Please sign in to comment.