From 202969fde9e5c73f0247d856ac2504c1f71e667b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Thu, 26 Jun 2014 14:25:04 +0200 Subject: [PATCH 1/3] Add store_description field for SEO --- core/lib/Thelia/Config/I18n/en_US.php | 1 + core/lib/Thelia/Config/I18n/fr_FR.php | 1 + core/lib/Thelia/Config/I18n/it_IT.php | 1 + .../Admin/ConfigStoreController.php | 1 + core/lib/Thelia/Form/ConfigStoreForm.php | 7 +++++++ setup/insert.sql | 1 + .../backOffice/default/config-store.html | 20 ++++++++++++++----- templates/frontOffice/default/layout.tpl | 4 +++- 8 files changed, 30 insertions(+), 6 deletions(-) diff --git a/core/lib/Thelia/Config/I18n/en_US.php b/core/lib/Thelia/Config/I18n/en_US.php index 6b92a7fb6..44a59c4a1 100644 --- a/core/lib/Thelia/Config/I18n/en_US.php +++ b/core/lib/Thelia/Config/I18n/en_US.php @@ -271,6 +271,7 @@ return array( 'Store logs into text file' => 'Store logs into text file', 'Store logs into text file, up to a certian size, then a new file is created' => 'Store logs into text file, up to a certian size, then a new file is created', 'Store name' => 'Store name', + 'Store description' => 'Store description', 'Street Address' => 'Street Address', 'Street Address ' => 'Street Address ', 'Strictly use the requested language' => 'Strictly use the requested language', diff --git a/core/lib/Thelia/Config/I18n/fr_FR.php b/core/lib/Thelia/Config/I18n/fr_FR.php index bd789a0ad..1efcd9824 100644 --- a/core/lib/Thelia/Config/I18n/fr_FR.php +++ b/core/lib/Thelia/Config/I18n/fr_FR.php @@ -271,6 +271,7 @@ return array( 'Store logs into text file' => 'Conserver les logs dans des fichiers texte', 'Store logs into text file, up to a certian size, then a new file is created' => 'Sauvegarder les logs dans un fichier texte. A partir d\'une certaine taille un nouveau fichier est créé', 'Store name' => 'Nom du magasin', + 'Store description' => 'Description du magasin', 'Street Address' => 'Adresse', 'Street Address ' => 'Rue', 'Strictly use the requested language' => 'Utiliser strictement la langue demandée', diff --git a/core/lib/Thelia/Config/I18n/it_IT.php b/core/lib/Thelia/Config/I18n/it_IT.php index 265f136eb..aaf07cd43 100644 --- a/core/lib/Thelia/Config/I18n/it_IT.php +++ b/core/lib/Thelia/Config/I18n/it_IT.php @@ -160,6 +160,7 @@ return array( 'Store logs into text file' => 'Archiviare i log in un file di testo', 'Store logs into text file, up to a certian size, then a new file is created' => 'Archiviare i log in un file di testo, fino ad una certa dimensione, dopo viene creato un nuovo file', 'Store name' => 'Nome del negozio', + 'Store description' => 'Descrizione del negozio', 'Street Address' => 'Indirizzo', 'Street Address ' => 'Indirizzo ', 'Strictly use the requested language' => 'Utilizzare rigorosamente la lingua richiesta', diff --git a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php index e76959864..0e7fb8090 100644 --- a/core/lib/Thelia/Controller/Admin/ConfigStoreController.php +++ b/core/lib/Thelia/Controller/Admin/ConfigStoreController.php @@ -36,6 +36,7 @@ class ConfigStoreController extends BaseAdminController // Hydrate the store configuration form $configStoreForm = new ConfigStoreForm($this->getRequest(), 'form', array( 'store_name' => ConfigQuery::read("store_name"), + 'store_description' => ConfigQuery::read("store_description"), 'store_email' => ConfigQuery::read("store_email"), 'store_business_id' => ConfigQuery::read("store_business_id"), 'store_phone' => ConfigQuery::read("store_phone"), diff --git a/core/lib/Thelia/Form/ConfigStoreForm.php b/core/lib/Thelia/Form/ConfigStoreForm.php index b7b49b2a0..ee9eb193e 100644 --- a/core/lib/Thelia/Form/ConfigStoreForm.php +++ b/core/lib/Thelia/Form/ConfigStoreForm.php @@ -29,6 +29,13 @@ class ConfigStoreForm extends BaseForm "for" => "store_name" ) )) + ->add("store_description", "text", array( + "label" => Translator::getInstance()->trans('Store description'), + "label_attr" => array( + "for" => "store_description" + ), + "required" => false + )) ->add("store_email", "text", array( "constraints" => array( new Constraints\NotBlank(), diff --git a/setup/insert.sql b/setup/insert.sql index d5ae99111..8e74b3804 100644 --- a/setup/insert.sql +++ b/setup/insert.sql @@ -39,6 +39,7 @@ INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updat ('session_config.default', '1', 1, 1, NOW(), NOW()), ('default_lang_without_translation', '1', 1, 1, NOW(), NOW()), ('store_name','', 0, 1, NOW(), NOW()), +('store_description','', 0, 1, NOW(), NOW()), ('store_email','', 0, 1, NOW(), NOW()), ('one_domain_foreach_lang','0', 1, 1, NOW(), NOW()), ('thelia_version','2.0.2', 1, 1, NOW(), NOW()), diff --git a/templates/backOffice/default/config-store.html b/templates/backOffice/default/config-store.html index dd648a943..61e302e8e 100644 --- a/templates/backOffice/default/config-store.html +++ b/templates/backOffice/default/config-store.html @@ -56,13 +56,23 @@
{form_field form=$form field='store_name'} -
- +
+ -
- -
+
+
+
+ {/form_field} + + {form_field form=$form field='store_description'} +
+ + +
+ +
+
{/form_field} {form_field form=$form field='store_business_id'} diff --git a/templates/frontOffice/default/layout.tpl b/templates/frontOffice/default/layout.tpl index 8a2d06a4c..fcc78b3b7 100644 --- a/templates/frontOffice/default/layout.tpl +++ b/templates/frontOffice/default/layout.tpl @@ -27,7 +27,9 @@ GNU General Public License : http://www.gnu.org/licenses/ {block name="no-return-functions"}{/block} {assign var="store_name" value="{config key="store_name"}"} +{assign var="store_description" value="{config key="store_description"}"} {if not $store_name}{assign var="store_name" value="{intl l='Thelia V2'}"}{/if} +{if not $store_description}{assign var="store_description" value="$store_name"}{/if} {* paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither *} @@ -49,7 +51,7 @@ GNU General Public License : http://www.gnu.org/licenses/ {block name="meta"} - + {/block} From 368e8cd6cfdfd18c9b8f29415d7e9af9920e33f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Tue, 1 Jul 2014 10:26:51 +0200 Subject: [PATCH 2/3] Add new entry : store_description --- setup/update/2.0.3.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup/update/2.0.3.sql b/setup/update/2.0.3.sql index 428d383d9..9b359dc4a 100644 --- a/setup/update/2.0.3.sql +++ b/setup/update/2.0.3.sql @@ -6,6 +6,9 @@ UPDATE `config` SET `value`='2.0.3' WHERE `name`='thelia_version'; UPDATE `config` SET `value`='3' WHERE `name`='thelia_release_version'; UPDATE `config` SET `value`='' WHERE `name`='thelia_extra_version'; +INSERT INTO `config` (`name`, `value`, `secured`, `hidden`, `created_at`, `updated_at`) VALUES +('store_description', '', 0, 0, NOW(), NOW()); + # Add new column to order (version, version_created_at, version_created_by) ALTER TABLE `order` ADD `version` INT DEFAULT 0 AFTER `updated_at`; From eed0b357aa7365bee22ada7d752fc7032139bae8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Espeche?= Date: Thu, 3 Jul 2014 08:57:14 +0200 Subject: [PATCH 3/3] Add code editor on textarea --- .../backOffice/default/message-edit.html | 55 +++++++++++++------ 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/templates/backOffice/default/message-edit.html b/templates/backOffice/default/message-edit.html index 1e6adc0ae..290242fa3 100644 --- a/templates/backOffice/default/message-edit.html +++ b/templates/backOffice/default/message-edit.html @@ -116,7 +116,7 @@ {form_field form=$form field='html_template_file_name'}
- {foreach $html_template_list as $template} @@ -132,11 +132,12 @@
{form_field form=$form field='html_message'}
-
{/form_field}
@@ -167,7 +168,7 @@ {form_field form=$form field='text_template_file_name'}
- {foreach $text_template_list as $template} @@ -183,11 +184,12 @@
{form_field form=$form field='text_message'}
-
{/form_field}
@@ -224,18 +226,39 @@ {/block} {block name="javascript-initialization"} + {/block}