From 1939b8026b1b1d497996e796b7bb2f877a06c1f6 Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 9 Oct 2013 18:06:42 +0200 Subject: [PATCH 1/6] // CSS fix --- admin-dev/themes/default/css/admin-theme.css | 19 +++++++++++-------- admin-dev/themes/default/css/admin-theme.sass | 2 ++ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/admin-dev/themes/default/css/admin-theme.css b/admin-dev/themes/default/css/admin-theme.css index 173f77c30..2b6127732 100644 --- a/admin-dev/themes/default/css/admin-theme.css +++ b/admin-dev/themes/default/css/admin-theme.css @@ -1,4 +1,4 @@ -/*! +/* * Bootstrap v3.0.0 * * Copyright 2013 Twitter, Inc @@ -7,7 +7,7 @@ * * Designed and built with all the love in the world by @mdo and @fat. */ -/*! normalize.css v2.1.0 | MIT License | git.io/normalize */ +/* normalize.css v2.1.0 | MIT License | git.io/normalize */ /* line 22, ../bower_components/sass-bootstrap/lib/_normalize.scss */ article, aside, details, figcaption, figure, footer, header, hgroup, main, nav, section, summary { display: block; } @@ -5717,7 +5717,7 @@ th.visible-print, td.visible-print { /* line 523, ../bower_components/sass-bootstrap/lib/_mixins.scss */ th.hidden-print, td.hidden-print { display: none !important; } } -/*! +/* * Font Awesome 3.2.1 * the iconic font designed for Bootstrap * ------------------------------------------------------------------------------ @@ -7730,17 +7730,20 @@ html, body { .page-head h2.page-title { padding: 0 0 0 20px; } } /* line 169, admin-theme.sass */ +.page-head a { + color: white; } +/* line 171, admin-theme.sass */ .page-head .btn-toolbar { margin: 0; padding: 3px 0 0 0; } -/* line 172, admin-theme.sass */ +/* line 174, admin-theme.sass */ .page-head .btn-toolbar .nav-tabs { margin: 0; } -/* line 174, admin-theme.sass */ +/* line 176, admin-theme.sass */ .page-head .btn-toolbar .nav-tabs > li > a { color: #333333; } -/* line 178, admin-theme.sass */ +/* line 180, admin-theme.sass */ .toolbar_btn { position: relative; padding: 2px 5px !important; @@ -7750,13 +7753,13 @@ html, body { color: white; text-align: center; text-shadow: none; } -/* line 187, admin-theme.sass */ +/* line 189, admin-theme.sass */ .toolbar_btn:hover { color: #8fc04d; border-color: white; background-color: white !important; } -/* line 192, admin-theme.sass */ +/* line 194, admin-theme.sass */ [class^="process-icon-"], [class*=" process-icon-"] { height: 25px; min-width: 32px; diff --git a/admin-dev/themes/default/css/admin-theme.sass b/admin-dev/themes/default/css/admin-theme.sass index b8a106463..ed70f70d1 100755 --- a/admin-dev/themes/default/css/admin-theme.sass +++ b/admin-dev/themes/default/css/admin-theme.sass @@ -166,6 +166,8 @@ html, body text-transform: uppercase @media (max-width: $screen-tablet) padding: 0 0 0 20px + a + color: white .btn-toolbar margin: 0 padding: 3px 0 0 0 From d4bf765dd626ee43994d18349675e324abc93c03 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 9 Oct 2013 18:31:51 +0200 Subject: [PATCH 2/6] // Pagination bootstraping --- .../template/helpers/list/list_footer.tpl | 106 +++++++++++++----- 1 file changed, 77 insertions(+), 29 deletions(-) diff --git a/admin-dev/themes/default/template/helpers/list/list_footer.tpl b/admin-dev/themes/default/template/helpers/list/list_footer.tpl index 010c1913b..b0f9585be 100644 --- a/admin-dev/themes/default/template/helpers/list/list_footer.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_footer.tpl @@ -24,9 +24,10 @@ *} - +
{if $bulk_actions} -
+
+
@@ -53,36 +54,83 @@ {/foreach}
- {/if} - - {if !$simple_header && $list_total > 20} -
- - {if $page > 1} -   - - {/if} - {l s='Page'} {$page} / {$total_pages} - {if $page < $total_pages} -   - - {/if} - - - -  |  - - - - / {$list_total} {l s='result(s)'}
{/if} + {if !$simple_header && $list_total > 20} +
+ {* Choose number of results per page *} + + {l s='Display'}: + + + / {$list_total} {l s='result(s)'} + + + +
    +
  • + + + +
  • +
  • + + + +
  • + {assign p 0} + {while $p++ < $total_pages} + {if $p < $page-2} +
  • + … +
  • + {assign p $page-3} + {else if $p > $page+2} +
  • + … +
  • + {assign p $total_pages} + {else} +
  • + {$p} +
  • + {/if} + {/while} +
  • $total_pages}class="disabled"{/if}> + + + +
  • +
  • $total_pages}class="disabled"{/if}> + + + +
  • +
+ +
+ {/if} +
{if !$simple_header} From eae76eb63e29cd3ff6e508071aa2e2ad1e1eb20f Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 9 Oct 2013 18:36:19 +0200 Subject: [PATCH 3/6] // Pagination bootstraping --- .../countries/helpers/list/list_footer.tpl | 70 ++++----- .../states/helpers/list/list_footer.tpl | 148 ++++++++++++------ .../template/helpers/list/list_footer.tpl | 5 +- 3 files changed, 137 insertions(+), 86 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/countries/helpers/list/list_footer.tpl b/admin-dev/themes/default/template/controllers/countries/helpers/list/list_footer.tpl index 04515e020..9c397bd5e 100644 --- a/admin-dev/themes/default/template/controllers/countries/helpers/list/list_footer.tpl +++ b/admin-dev/themes/default/template/controllers/countries/helpers/list/list_footer.tpl @@ -23,48 +23,43 @@ * International Registered Trademark & Property of PrestaShop SA *} - - {if !$simple_header && $list_total > 20}
- {if $bulk_actions} -
- {if $bulk_actions|count > 1} -
-
- -
-
- -
+ {if $bulk_actions} + {if $bulk_actions|count > 1} +
+
+
- {else} - {foreach $bulk_actions as $key => $params} -
-
- {if $key == 'affectzone'} - - {/if} -
-
- -
+
+
- {/foreach} - {/if} -
+
+ {else} + {foreach $bulk_actions as $key => $params} +
+
+ {if $key == 'affectzone'} + + {/if} +
+
+ +
+
+ {/foreach} {/if} + {/if}
- - + {if !$simple_header && $list_total > 20}
{* Choose number of results per page *} @@ -136,9 +131,8 @@ });
+ {/if}
- {/if} - diff --git a/admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl b/admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl index 84f7fb5ca..9bd8862f9 100644 --- a/admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl +++ b/admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl @@ -24,58 +24,116 @@ *} - {if !$simple_header && $list_total > 20} -
- - {if $page > 1} -   - - {/if} - {l s='Page'} {$page} / {$total_pages} - {if $page < $total_pages} -   - - {/if} - - - -  |  - - - - / {$list_total} {l s='result(s)'} -
- {/if} - {if $bulk_actions} - {if $bulk_actions|count > 1} -
- +
+
+ {if $bulk_actions} + {if $bulk_actions|count > 1} +
+
+ +
+
+ +
- - {else} - {foreach $bulk_actions as $key => $params} - {if $key == 'affectzone'} -
+ {else} + {foreach $bulk_actions as $key => $params} +
+
+ {if $key == 'affectzone'} + + {/if}
- {/if} - - {/foreach} +
+ +
+
+ {/foreach} + {/if} {/if} - {/if} +
+ {if !$simple_header && $list_total > 20} +
+ {* Choose number of results per page *} + + {l s='Display'}: + + + / {$list_total} {l s='result(s)'} + + + +
    +
  • + + + +
  • +
  • + + + +
  • + {assign p 0} + {while $p++ < $total_pages} + {if $p < $page-2} +
  • + … +
  • + {assign p $page-3} + {else if $p > $page+2} +
  • + … +
  • + {assign p $total_pages} + {else} +
  • + {$p} +
  • + {/if} + {/while} +
  • $total_pages}class="disabled"{/if}> + + + +
  • +
  • $total_pages}class="disabled"{/if}> + + + +
  • +
+ +
+ {/if} +
diff --git a/admin-dev/themes/default/template/helpers/list/list_footer.tpl b/admin-dev/themes/default/template/helpers/list/list_footer.tpl index b0f9585be..d0d8bd7eb 100644 --- a/admin-dev/themes/default/template/helpers/list/list_footer.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_footer.tpl @@ -25,8 +25,8 @@
- {if $bulk_actions}
+ {if $bulk_actions}
+ {/if}
- {/if} - {if !$simple_header && $list_total > 20}
{* Choose number of results per page *} From 2d9a54c19efbf84fbfca515f2942910013750067 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 9 Oct 2013 18:43:22 +0200 Subject: [PATCH 4/6] // Remove button icon class --- admin-dev/themes/default/template/helpers/options/options.tpl | 1 - 1 file changed, 1 deletion(-) diff --git a/admin-dev/themes/default/template/helpers/options/options.tpl b/admin-dev/themes/default/template/helpers/options/options.tpl index 138a7f9c9..dc9b61efb 100644 --- a/admin-dev/themes/default/template/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/helpers/options/options.tpl @@ -367,7 +367,6 @@ name="{if isset($categoryData['submit']['name'])}{$categoryData['submit']['name']}{else}submitOptions{$table}{/if}" class="btn btn-default {if isset($categoryData['submit']['class'])}{$categoryData['submit']['class']}{else}btn btn-default{/if}" > - {if isset($categoryData['submit']['title'])}{$categoryData['submit']['title']}{else}{l s='Save'}{/if}
From cfbb0d872b946d4051662ec969943e0eed38956a Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Wed, 9 Oct 2013 18:47:33 +0200 Subject: [PATCH 5/6] // Add confirmation on category image delete --- .../template/controllers/categories/helpers/form/form.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl index 52ea0c848..bf1bc5c87 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl @@ -34,7 +34,7 @@ {if $shared_category}

{l s='If you delete this picture, it will be deleted in all of your shared shops!'}

{/if} - + {l s='Delete'}
From 079534f039ebf4c58619ff6b9359ccfda3f81dce Mon Sep 17 00:00:00 2001 From: Damien Metzger Date: Wed, 9 Oct 2013 18:51:20 +0200 Subject: [PATCH 6/6] // Fix header/footer override in admincontroller --- classes/controller/AdminController.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 35f464df6..a7c460eb5 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1343,16 +1343,9 @@ class AdminControllerCore extends Controller $template_dirs = $this->context->smarty->getTemplateDir(); // Check if header/footer have been overriden - $header_tpl = 'header.tpl'; - $footer_tpl = 'footer.tpl'; - foreach ($template_dirs as $template_dir) - { - if (file_exists($template_dir.DIRECTORY_SEPARATOR.'header.tpl')) - $header_tpl = $template_dir.DIRECTORY_SEPARATOR.'header.tpl'; - if (file_exists($template_dir.DIRECTORY_SEPARATOR.'footer.tpl')) - $footer_tpl = $template_dir.DIRECTORY_SEPARATOR.'footer.tpl'; - } - + $dir = $this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.trim($this->override_folder, '\\/').DIRECTORY_SEPARATOR; + $header_tpl = file_exists($dir.'header.tpl') ? $dir.'header.tpl' : 'header.tpl'; + $footer_tpl = file_exists($dir.'footer.tpl') ? $dir.'footer.tpl' : 'footer.tpl'; $tpl_action = $this->tpl_folder.$this->display.'.tpl'; // Check if action template has been overriden @@ -3035,7 +3028,7 @@ class AdminControllerCore extends Controller { if (file_exists($this->context->smarty->getTemplateDir(1).DIRECTORY_SEPARATOR.$this->override_folder.$tpl_name)) return $this->context->smarty->createTemplate($this->override_folder.$tpl_name, $this->context->smarty); - else if (file_exists($this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$tpl_name)) + elseif (file_exists($this->context->smarty->getTemplateDir(0).'controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$tpl_name)) return $this->context->smarty->createTemplate('controllers'.DIRECTORY_SEPARATOR.$this->override_folder.$tpl_name, $this->context->smarty); }