Merge pull request #503 from mespeche/mespeche

Added store_description
This commit is contained in:
Julien
2014-07-08 15:21:33 +02:00
10 changed files with 72 additions and 22 deletions

View File

@@ -282,6 +282,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',

View File

@@ -282,6 +282,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',

View File

@@ -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',

View File

@@ -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"),

View File

@@ -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(),

View File

@@ -40,6 +40,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()),

View File

@@ -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`;

View File

@@ -56,13 +56,23 @@
<fieldset>
{form_field form=$form field='store_name'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Used in your store front'}">
</div>
<div class="form-group">
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}"{if $required} aria-required="true" required{/if} title="{$label}" placeholder="{intl l='Used in your store front'}">
</div>
</div>
{/form_field}
{form_field form=$form field='store_description'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}:{if $required} <span class="required">*</span>{/if}</label>
<div class="form-group">
<textarea name="{$name}" id="{$label_attr.for}" title="{$label}" class="form-control" placeholder="{intl l='Used in your store front'}" rows="3"{if $required} aria-required="true" required{/if}>{$value}</textarea>
</div>
</div>
{/form_field}
{form_field form=$form field='store_business_id'}

View File

@@ -116,7 +116,7 @@
{form_field form=$form field='html_template_file_name'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select data-toggle-textarea="html-message-content" id="{$label_attr.for}" name="{$name}" {if $required}required="required"{/if} title="{$label}" class="textarea-toggle form-control">
<select data-toggle-textarea="thelia_message_modification[html_message]" id="{$label_attr.for}" name="{$name}" {if $required}required="required"{/if} title="{$label}" class="textarea-toggle form-control">
<option value="">{intl l='Use HTML message defined below'}</option>
{foreach $html_template_list as $template}
<option value="{$template}" {if $template == $value}selected="selected"{/if}>{$template}</option>
@@ -132,11 +132,12 @@
<div class="col-md-12">
{form_field form=$form field='html_message'}
<div class="form-group {if $error}has-error{/if}">
<label for="html-message-content" class="control-label">
<label for="{$label_attr.for}" class="control-label">
{$label}{if $required} <span class="required">*</span>{/if} :
<span class="label-help-block">{intl l="The mailing template in HTML format."}</span>
</label>
<textarea {$disable_html} {if $required}required="required"{/if} name="{$name}" id="html-message-content" rows="10" class="fixedfont form-control">{$value}</textarea>
<textarea {$disable_html} {if $required}required="required"{/if} name="{$name}" rows="10" class="fixedfont form-control">{$value}</textarea>
<div id="{$name}" style="height: 500px;">{$value}</div>
</div>
{/form_field}
</div>
@@ -167,7 +168,7 @@
{form_field form=$form field='text_template_file_name'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label}{if $required} <span class="required">*</span>{/if} : </label>
<select data-toggle-textarea="text-message-content" id="{$label_attr.for}" name="{$name}" {if $required}required="required"{/if} title="{$label}" class="textarea-toggle form-control">
<select data-toggle-textarea="thelia_message_modification[text_message]" id="{$label_attr.for}" name="{$name}" {if $required}required="required"{/if} title="{$label}" class="textarea-toggle form-control">
<option value="">{intl l='Use Text message defined below'}</option>
{foreach $text_template_list as $template}
<option value="{$template}" {if $template == $value}selected="selected"{/if}>{$template}</option>
@@ -183,11 +184,12 @@
<div class="col-md-12">
{form_field form=$form field='text_message'}
<div class="form-group {if $error}has-error{/if}">
<label for="text-message-content" class="control-label">
<label for="{$label_attr.for}" class="control-label">
{$label}{if $required} <span class="required">*</span>{/if} :
<span class="label-help-block">{intl l="The mailing template in text-only format."}</span>
</label>
<textarea {$disable_text} id="text-message-content" {if $required}required="required"{/if} name="{$name}" rows="10" class="fixedfont form-control">{$value}</textarea>
<textarea {$disable_text} {if $required}required="required"{/if} name="{$name}" rows="10" class="fixedfont form-control">{$value}</textarea>
<div id="{$name}" style="height: 500px;">{$value}</div>
</div>
{/form_field}
</div>
@@ -224,18 +226,39 @@
{/block}
{block name="javascript-initialization"}
<script src="//cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
<script>
(function($) {
$('select.textarea-toggle').change(function(ev) {
if ($(this).val() != '') {
$('#' + $(this).data('toggle-textarea')).addClass("disabled").prop('readonly', true);
}
else {
$('#' + $(this).data('toggle-textarea')).removeClass('disabled').prop('readonly', false);
}
});
(function($) {
})(jQuery);
var editor;
$('select.textarea-toggle').change(function(ev) {
if ($(this).val() != '') {
editor = ace.edit($(this).data('toggle-textarea'));
editor.setReadOnly(true);
}
else {
editor = ace.edit($(this).data('toggle-textarea'));
editor.setReadOnly(true);
}
});
var elems = ["thelia_message_modification[html_message]", "thelia_message_modification[text_message]"]
$.each(elems, function(index, value){
editor = ace.edit(value);
var textarea = $('textarea[name="' + value + '"]').hide();
editor.setTheme("ace/theme/monokai");
editor.getSession().setMode("ace/mode/smarty");
editor.getSession().on("change", function () {
textarea.val(editor.getSession().getValue());
});
textarea.val(editor.getSession().getValue());
});
})(jQuery);
</script>
{/block}

View File

@@ -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 *}
<!--[if lt IE 7 ]><html class="no-js oldie ie6" lang="{lang attr="code"}"> <![endif]-->
@@ -49,7 +51,7 @@ GNU General Public License : http://www.gnu.org/licenses/
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
{block name="meta"}
<meta name="description" content="{if $page_description}{$page_description}{else}{$store_name}{/if}">
<meta name="description" content="{if $page_description}{$page_description}{else}{$store_description}{/if}">
<meta name="robots" content="noindex,nofollow">
{/block}