From 9655ce3c72704fc5ccd48104f3f2e6121d57265f Mon Sep 17 00:00:00 2001 From: franck Date: Fri, 6 Sep 2013 09:56:39 +0200 Subject: [PATCH 01/15] Added a 'development mode' to assetic smarty plugin --- core/lib/Thelia/Config/Resources/config.xml | 1 + .../Core/Template/Assets/AsseticHelper.php | 18 +++++++++--------- .../Smarty/Assets/SmartyAssetsManager.php | 13 +++++++++---- .../Core/Template/Smarty/Plugins/Assetic.php | 4 ++-- templates/admin/default/assets/less/main.less | 4 +--- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/core/lib/Thelia/Config/Resources/config.xml b/core/lib/Thelia/Config/Resources/config.xml index 96e5941cd..198c49228 100755 --- a/core/lib/Thelia/Config/Resources/config.xml +++ b/core/lib/Thelia/Config/Resources/config.xml @@ -129,6 +129,7 @@ + %kernel.environment% diff --git a/core/lib/Thelia/Core/Template/Assets/AsseticHelper.php b/core/lib/Thelia/Core/Template/Assets/AsseticHelper.php index fbb93440a..cd7f06ac8 100755 --- a/core/lib/Thelia/Core/Template/Assets/AsseticHelper.php +++ b/core/lib/Thelia/Core/Template/Assets/AsseticHelper.php @@ -43,15 +43,16 @@ class AsseticHelper * Generates assets from $asset_path in $output_path, using $filters. * * @param string $asset_path the full path to the asset file (or file collection) - * @param unknown $output_path the full disk path to the output directory (shoud be visible to web server) - * @param unknown $output_url the URL to the generated asset directory - * @param unknown $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. - * @param unknown $filters a list of filters, as defined below (see switch($filter_name) ...) - * @param unknown $debug true / false + * @param string $output_path the full disk path to the output directory (shoud be visible to web server) + * @param string $output_url the URL to the generated asset directory + * @param string $asset_type the asset type: css, js, ... The generated files will have this extension. Pass an empty string to use the asset source extension. + * @param array $filters a list of filters, as defined below (see switch($filter_name) ...) + * @param boolean $debug true / false + * @param boolean $dev_mode true / false. If true, assets are not cached and always compiled. * @throws \InvalidArgumentException if an invalid filter name is found * @return string The URL to the generated asset file. */ - public function asseticize($asset_path, $output_path, $output_url, $asset_type, $filters, $debug) + public function asseticize($asset_path, $output_path, $output_url, $asset_type, $filters, $debug, $dev_mode = false) { $asset_name = basename($asset_path); $asset_dir = dirname($asset_path); @@ -112,6 +113,7 @@ class AsseticHelper $asset = $factory->createAsset($asset_name); $asset_target_path = $asset->getTargetPath(); + $target_file = sprintf("%s/%s", $output_path, $asset_target_path); // As it seems that assetic cannot handle a real file cache, let's do the job ourselves. @@ -124,7 +126,7 @@ class AsseticHelper // // before generating 3bc974a-ad3ef47.css, delete 3bc974a-* files. // - if (! file_exists($target_file)) { + if ($dev_mode == true || ! file_exists($target_file)) { // Delete previous version of the file list($commonPart, $dummy) = explode('-', $asset_target_path); @@ -143,8 +145,6 @@ class AsseticHelper } } - //$cache = new AssetCache($asset, new FilesystemCache($output_path)); - $writer = new AssetWriter($output_path); $writer->writeAsset($asset); diff --git a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php index 17fe122d3..f19eded95 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php +++ b/core/lib/Thelia/Core/Template/Smarty/Assets/SmartyAssetsManager.php @@ -34,18 +34,22 @@ class SmartyAssetsManager private $web_root; private $path_relative_to_web_root; + private $developmentMode; /** * Creates a new SmartyAssetsManager instance * - * @param string $web_root the disk path to the web root - * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated + * @param string $web_root the disk path to the web root + * @param string $path_relative_to_web_root the path (relative to web root) where the assets will be generated + * @param boolean $developmentMode true / false. If true, assets are not cached, and always generated. */ - public function __construct($web_root, $path_relative_to_web_root) + public function __construct($web_root, $path_relative_to_web_root, $developmentMode) { $this->web_root = $web_root; $this->path_relative_to_web_root = $path_relative_to_web_root; + $this->developmentMode = $developmentMode; + $this->assetic_manager = new AsseticHelper(); } @@ -73,7 +77,8 @@ class SmartyAssetsManager URL::getInstance()->absoluteUrl($this->path_relative_to_web_root, null, URL::PATH_TO_FILE /* path only */), $assetType, $filters, - $debug + $debug, + $this->developmentMode ); return $url; diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php index f8ea1c2ef..b7bb95b83 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Assetic.php @@ -32,13 +32,13 @@ class Assetic extends AbstractSmartyPlugin { public $assetManager; - public function __construct() + public function __construct($developmentMode) { $web_root = THELIA_WEB_DIR; $asset_dir_from_web_root = ConfigQuery::read('asset_dir_from_web_root', 'assets'); - $this->assetManager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root); + $this->assetManager = new SmartyAssetsManager($web_root, $asset_dir_from_web_root, $developmentMode == 'dev'); } public function blockJavascripts($params, $content, \Smarty_Internal_Template $template, &$repeat) diff --git a/templates/admin/default/assets/less/main.less b/templates/admin/default/assets/less/main.less index 862810f6d..7ad14e013 100644 --- a/templates/admin/default/assets/less/main.less +++ b/templates/admin/default/assets/less/main.less @@ -3,6 +3,4 @@ /* Thelia Admin */ @import "thelia/thelia.less"; -// @import "thelia/responsive.less"; - -//mmm \ No newline at end of file +// @import "thelia/responsive.less"; \ No newline at end of file From 012432dad01278783cab2d4b16cc64736b33eb86 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 6 Sep 2013 09:58:35 +0200 Subject: [PATCH 02/15] clear asset cache in cache:cler command --- core/lib/Thelia/Command/CacheClear.php | 44 ++++++++++++++++++-------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/core/lib/Thelia/Command/CacheClear.php b/core/lib/Thelia/Command/CacheClear.php index 82a7cbd7f..37e853f05 100755 --- a/core/lib/Thelia/Command/CacheClear.php +++ b/core/lib/Thelia/Command/CacheClear.php @@ -24,6 +24,7 @@ namespace Thelia\Command; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Filesystem\Exception\IOException; @@ -44,7 +45,14 @@ class CacheClear extends ContainerAwareCommand { $this ->setName("cache:clear") - ->setDescription("Invalidate all caches"); + ->setDescription("Invalidate all caches") + ->addOption( + "without-assets", + null, + InputOption::VALUE_NONE, + "remove cache assets" + ) + ; } protected function execute(InputInterface $input, OutputInterface $output) @@ -52,20 +60,28 @@ class CacheClear extends ContainerAwareCommand $cacheDir = $this->getContainer()->getParameter("kernel.cache_dir"); - if (!is_writable($cacheDir)) { - throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $cacheDir)); - } - - $output->writeln(sprintf("Clearing cache in %s directory", $cacheDir)); - - $fs = new Filesystem(); - try { - $fs->remove($cacheDir); - - $output->writeln("cache cleared successfully"); - } catch (IOException $e) { - $output->writeln(sprintf("error during clearing cache : %s", $e->getMessage())); + $this->clearCache($cacheDir, $output); + if(!$input->getOption("without-assets")) { + $this->clearCache(THELIA_WEB_DIR . "/assets", $output); } } + + protected function clearCache($dir, OutputInterface $output) + { + if (!is_writable($dir)) { + throw new \RuntimeException(sprintf('Unable to write in the "%s" directory', $dir)); + } + + $output->writeln(sprintf("Clearing cache in %s directory", $dir)); + + $fs = new Filesystem(); + try { + $fs->remove($dir); + + $output->writeln(sprintf("%s cache dir cleared successfully", $dir)); + } catch (IOException $e) { + $output->writeln(sprintf("error during clearing cache : %s", $e->getMessage())); + } + } } From 2ef5e8bd0c78ab90ca3bda24992c6fcd675dd863 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Fri, 6 Sep 2013 10:08:30 +0200 Subject: [PATCH 03/15] fix test suite --- core/lib/Thelia/Tests/Command/CacheClearTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/core/lib/Thelia/Tests/Command/CacheClearTest.php b/core/lib/Thelia/Tests/Command/CacheClearTest.php index ed2e512b6..741fad299 100755 --- a/core/lib/Thelia/Tests/Command/CacheClearTest.php +++ b/core/lib/Thelia/Tests/Command/CacheClearTest.php @@ -47,6 +47,7 @@ class CacheClearTest extends \PHPUnit_Framework_TestCase $fs = new Filesystem(); $fs->mkdir($this->cache_dir); + $fs->mkdir(THELIA_WEB_DIR . "/assets"); } public function testCacheClear() From 617b762d8ab8ccdd6b7dc85b5641a6dd49105979 Mon Sep 17 00:00:00 2001 From: mespeche Date: Fri, 6 Sep 2013 10:16:08 +0200 Subject: [PATCH 04/15] Working : Resize countries flag + Add bootstrap-switch --- .../admin/default/assets/img/flags/en.gif | Bin 1256 -> 3098 bytes .../admin/default/assets/img/flags/es.gif | Bin 1262 -> 3059 bytes .../admin/default/assets/img/flags/fr.gif | Bin 1277 -> 3053 bytes .../admin/default/assets/img/flags/it.gif | Bin 1269 -> 3054 bytes .../js/bootstrap-switch/bootstrap-switch.js | 382 ++++++++++++++++++ .../assets/less/thelia/bootstrap-switch.less | 160 ++++++++ .../default/assets/less/thelia/thelia.less | 1 + templates/admin/default/currencies.html | 10 +- .../default/includes/add-category-dialog.html | 6 +- 9 files changed, 554 insertions(+), 5 deletions(-) create mode 100644 templates/admin/default/assets/js/bootstrap-switch/bootstrap-switch.js create mode 100644 templates/admin/default/assets/less/thelia/bootstrap-switch.less diff --git a/templates/admin/default/assets/img/flags/en.gif b/templates/admin/default/assets/img/flags/en.gif index 3a7661fdbc59f3153a66a613a8c95ccf4dd6c2fe..91b2b009016300632f1547ba2d5be5185fa4851d 100755 GIT binary patch literal 3098 zcmd5;YgAKL7T(Fd2`U&xt?$wJghfGvScOul;US44VgLuxsxi5cNFeD=0u;f8paV{+ z@=(DCh=76?0R@+cFDleW44^2l3P{nqXa~FKbXI4&X4%ZX2?m_HI)5iwIr*~pxA*z> zKIfhjfAJc352-!a!#@E+0CoZ#2F`I{eF2a?#c!Q#qbQFXA$GenmkvMx4s zZK1xa!;;p9sZzs&ABV3`+8TOvYw(k;!G=#ZY}u|+ZU0mx{Y!~-QS;=ke5z6Z_Ac zEXc_}*O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ch/bootstrap-switch.js b/templates/admin/default/assets/js/bootstrap-switch/bootstrap-switch.js new file mode 100644 index 000000000..1538f9df1 --- /dev/null +++ b/templates/admin/default/assets/js/bootstrap-switch/bootstrap-switch.js @@ -0,0 +1,382 @@ +/*! ============================================================ + * bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru + * http://www.larentis.eu/ + * + * Enhanced for radiobuttons by Stein, Peter @BdMdesigN + * http://www.bdmdesign.org/ + * + * Project site: + * http://www.larentis.eu/switch/ + * ============================================================ + * Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * ============================================================ */ + +!function ($) { + "use strict"; + + $.fn['bootstrapSwitch'] = function (method) { + var inputSelector = 'input[type!="hidden"]'; + var methods = { + init: function () { + return this.each(function () { + var $element = $(this) + , $div + , $switchLeft + , $switchRight + , $label + , $form = $element.closest('form') + , myClasses = "" + , classes = $element.attr('class') + , color + , moving + , onLabel = "ON" + , offLabel = "OFF" + , icon = false + , textLabel = false; + + $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) { + if (classes.indexOf(el) >= 0) + myClasses = el; + }); + + $element.addClass('has-switch'); + + if ($element.data('on') !== undefined) + color = "switch-" + $element.data('on'); + + if ($element.data('on-label') !== undefined) + onLabel = $element.data('on-label'); + + if ($element.data('off-label') !== undefined) + offLabel = $element.data('off-label'); + + if ($element.data('label-icon') !== undefined) + icon = $element.data('label-icon'); + + if ($element.data('text-label') !== undefined) + textLabel = $element.data('text-label'); + + $switchLeft = $('') + .addClass("switch-left") + .addClass(myClasses) + .addClass(color) + .html(onLabel); + + color = ''; + if ($element.data('off') !== undefined) + color = "switch-" + $element.data('off'); + + $switchRight = $('') + .addClass("switch-right") + .addClass(myClasses) + .addClass(color) + .html(offLabel); + + $label = $('