This commit is contained in:
mespeche
2013-09-12 12:41:30 +02:00
74 changed files with 2204 additions and 996 deletions

View File

@@ -224,7 +224,7 @@
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
{debugbar_renderjs}
{debugbar_renderresult}
{block name="after-javascript-include"}{/block}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@@ -0,0 +1,148 @@
$(function($){
// Clean array from deleteValue (undefined) keys
Array.prototype.clean = function(deleteValue) {
for (var i = 0; i < this.length; i++) {
if (this[i] == deleteValue) {
this.splice(i, 1);
i--;
}
}
return this;
};
// Remove 1 Rule then Save Rules AJAX
couponManager.removeRuleAjax = function(id) {
// Delete rule in temporary array
delete couponManager.rulesToSave[id];
couponManager.rulesToSave.clean(undefined);
// Save
couponManager.saveRuleAjax();
};
// Add 1 Rule / or update the temporary Rules array then Save Rules via AJAX
couponManager.addRuleAjax = function(id) {
console.log('addRuleAjax '+ id);
// If create
if(!id) {
console.log('pushing');
couponManager.rulesToSave.push(couponManager.ruleToSave);
} else { // else update
console.log('editing ' + id);
couponManager.rulesToSave[id] = couponManager.ruleToSave;
// reset edit mode to off
couponManager.ruleIdToUpdate = false;
}
// Save
couponManager.saveRuleAjax();
};
// Set rule inputs to allow editing
couponManager.updateRuleAjax = function(id) {
couponManager.ruleToUpdate = couponManager.rulesToSave[id];
console.log('Set id to edit to ' + id);
couponManager.ruleIdToUpdate = id;
// Deleting this rule, we will reset it
delete couponManager.rulesToSave[id];
// Set the rule selector
$("#category-rule option").filter(function() {
return $(this).val() == couponManager.ruleToUpdate.serviceId;
}).prop('selected', true);
// Force rule input refresh
couponManager.loadRuleInputs(couponManager.ruleToUpdate.serviceId, function() {
couponManager.fillInRuleInputs();
});
};
// Fill in rule inputs
couponManager.fillInRuleInputs = function() {
console.log('fillInRuleInputs with');
console.log(couponManager.ruleToUpdate);
var operatorId = null;
var valueId = null;
var idName = null;
for (idName in couponManager.ruleToUpdate.operators) {
// Setting idName operator select
operatorId = idName + '-operator';
$('#' + operatorId).val(couponManager.ruleToUpdate.operators[idName]);
valueId = idName + '-value';
// Setting idName value input
$('#' + valueId).val(couponManager.ruleToUpdate.values[idName]);
}
couponManager.ruleToSave = couponManager.ruleToUpdate;
var id = couponManager.ruleIdToUpdate;
console.log('id to edit = ' + id);
if(id) {
console.log('setint rulesToSave[' + id + ']');
console.log(couponManager.ruleToSave);
couponManager.rulesToSave[id] = couponManager.ruleToSave;
}
};
// Save rules on click
couponManager.onClickSaveRule = function() {
$('#constraint-save-btn').on('click', function () {
couponManager.addRuleAjax(couponManager.ruleIdToUpdate);
});
};
couponManager.onClickSaveRule();
// Remove rule on click
couponManager.onClickDeleteRule = function() {
$('.constraint-delete-btn').on('click', function (e) {
e.preventDefault();
var $this = $(this);
couponManager.removeRuleAjax($this.attr('data-int'));
});
};
couponManager.onClickDeleteRule();
// Update rule on click
couponManager.onClickUpdateRule = function() {
$('.constraint-update-btn').on('click', function (e) {
e.preventDefault();
var $this = $(this);
couponManager.updateRuleAjax($this.attr('data-int'));
// Hide row being updated
$this.parent().parent().remove();
});
};
couponManager.onClickUpdateRule();
// Reload effect inputs when changing effect
couponManager.onEffectChange = function() {
$('#effect').on('change', function () {
var optionSelected = $("option:selected", this);
$('#effectToolTip').html(optionSelected.attr("data-description"));
});
};
couponManager.onEffectChange();
// Reload rule inputs when changing effect
couponManager.onRuleChange = function() {
$('#category-rule').on('change', function () {
couponManager.loadRuleInputs($(this).val(), function(ruleToSave) {});
});
};
couponManager.onRuleChange();
// Fill in ready to be saved rule array
// var onInputsChange = function()
// In AJAX response
});
// Rule to save
var couponManager = {};
couponManager.ruleToSave = {};
couponManager.ruleIdToUpdate = false;

View File

@@ -40,7 +40,7 @@
line-height: @topBarHeight;
height: @topBarHeight;
background: url("@{imgDir}/top-bar-logo.png") left -3px no-repeat;
padding-left: 100px;
padding-left: 170px;
text-shadow: 0px 1px 1px black;
color: #6d737b;
}
@@ -261,6 +261,6 @@
.loading{
background: url("@{imgDir}/ajax-loader.gif") no-repeat;
height: 24px;
width: 24px;
height: 30px;
width: 30px;
}

View File

@@ -16,7 +16,7 @@
</div>
{form name="thelia.admin.coupon.creation"}
{include file='coupon/form.html' formAction={url path={$formAction}}}
{include file='coupon/form.html' formAction={url path={$formAction}} noRules=true}
{/form}
</section> <!-- #wrapper -->

View File

@@ -16,9 +16,10 @@
</div>
{form name="thelia.admin.coupon.creation"}
{include file='coupon/form.html' formAction={url path={$formAction}} form=$form}
{include file='coupon/form.html' formAction={url path={$formAction}} form=$form noRules=false}
{/form}
</section> <!-- #wrapper -->
{/block}
@@ -37,19 +38,19 @@
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/coupon.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script>
$(function($){
miniBrowser(0, '/test_to_remove/datas_coupon_edit.json');
// Init Rules
var initRule = function() {
couponManager.initRules = function() {
var rules = [];
{foreach from=$rulesObject key=k item=rule}
// Init rule
var rule = {};
rule['serviceId'] = '{$rule.serviceId nofilter}';
rule['operators'] = {};
@@ -59,24 +60,24 @@
rule['operators']['{$input nofilter}'] = '{$operator nofilter}';
rule['values']['{$input nofilter}'] = '{$rule.validators.setValues[$input] nofilter}';
{/foreach}
// Add rule
rules.push(rule);
{/foreach}
return rules;
}
};
// Save Rules AJAX
var saveRuleAjax = function() {
couponManager.saveRuleAjax = function() {
$('#constraint-add-operators-values').html('<div class="loading" ></div>');
console.log('about to save');
console.log(couponManager.rulesToSave);
var $url = '{$urlAjaxUpdateRules}';
console.log('save');
console.log('{$urlAjaxUpdateRules}');
console.log(rules);
console.log(JSON.stringify(rules));
$.ajax({
type: "POST",
url: $url,
{*data: {literal}{{/literal}rules:rules{literal}}{/literal},*}
data: {literal}{{/literal}rules:JSON.stringify(rules){literal}}{/literal},
data: {literal}{{/literal}rules:JSON.stringify(couponManager.rulesToSave){literal}}{/literal},
statusCode: {
404: function() {
$('#constraint-add-operators-values').html(
@@ -87,75 +88,34 @@
}).done(function(data) {
$('#constraint-list').html(data);
$('#constraint-add-operators-values').html('');
couponManager.onClickUpdateRule();
couponManager.onClickDeleteRule();
});
}
};
// Remove 1 Rule then Save Rules AJAX
var removeRuleAjax = function($id) {
rules.slice($id, 1);
saveRuleAjax();
}
// Add 1 Rule then Save Rules AJAX
var addRuleAjax = function() {
rules.push(ruleToSave);
saveRuleAjax();
}
var rules = initRule();
console.log(rules);
// Save rules on click
var onClickSaveRule = function() {
$('#constraint-save-btn').on('click', function (e) {
addRuleAjax();
});
}
onClickSaveRule();
// Remove rule on click
var onClickDeleteRule = function() {
$('#constraint-delete-btn').on('click', function (e) {
// removeRuleAjax();
});
}
onClickDeleteRule();
// Reload effect inputs when changing effect
var onEffectChange = function() {
$('#effect').on('change', function (e) {
var optionSelected = $("option:selected", this);
$('#effectToolTip').html(optionSelected.attr("data-description"));
});
}
onEffectChange();
// Reload rule inputs when changing effect
var onRuleChange = function() {
$('#category-rule').on('change', function (e) {
$('#constraint-add-operators-values').html('<div class="loading" ></div>');
var url = "{$urlAjaxGetRuleInput}";
url = url.replace('ruleId', $(this).val())
$.ajax({
url: url,
statusCode: {
404: function() {
$('#constraint-add-operators-values').html(
'{intl l='Please select another rule'}'
);
}
// Reload rule inputs
couponManager.loadRuleInputs = function(ruleId, callBack) {
$('#constraint-add-operators-values').html('<div class="loading" ></div>');
var url = "{$urlAjaxGetRuleInput}";
url = url.replace('ruleId', ruleId)
$.ajax({
url: url,
statusCode: {
404: function() {
$('#constraint-add-operators-values').html(
'{intl l='Please select another rule'}'
);
}
}).done(function(data) {
$('#constraint-add-operators-values').html(data);
});
}
}).done(function(data) {
$('#constraint-add-operators-values').html(data);
return callBack();
});
}
onRuleChange();
};
// Rules which will be saved
couponManager.rulesToSave = couponManager.initRules();
});
</script>
{/block}

View File

@@ -161,134 +161,122 @@
</div>
</section>
<section class="row">
<div class="col-md-12 general-block-decorator">
<table class="table table-striped">
<caption class="clearfix">
{intl l='Rules'}
</caption>
<thead>
<tr>
<th>{intl l='Conditions'}</th>
<th>{intl l='Actions'}</th>
</tr>
</thead>
<tbody id="constraint-list">
{include file='coupon/rules.html' rules=$rulesObject}
{*{foreach from=$rulesObject item=rule name=rulesForeach}*}
{*<tr>*}
{*<td>*}
{*{if !$smarty.foreach.rulesForeach.first}*}
{*<span class="label label-info">{intl l='And'}</span>*}
{*{/if}*}
{*{$rule.tooltip nofilter}*}
{*</td>*}
{*<td>*}
{*<a href="#url" class="btn btn-default btn-primary btn-medium"><span class="glyphicon glyphicon-edit"></span> {intl l='Edit'}</a>*}
{*<a href="#url" class="btn btn-default btn-danger btn-medium" data-toggle="confirm" data-target="#delete"><span class="glyphicon glyphicon-remove"></span> {intl l='Delete'}</a>*}
{*</td>*}
{*</tr>*}
{*{/foreach}*}
</tbody>
</table>
</div>
</section>
<section class="row">
<div class="col-md-12 general-block-decorator clearfix">
<a id="constraint-save-btn" title="{intl l='Save this rule'}" class="btn btn-default btn-primary pull-right">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
<div id="rule-add-organizer" class="form-group col-md-2">
<label for="type">{intl l='Condition type :'}</label>
<label class="radio">
<input type="radio" name="type" id="type" value="1" checked> {intl l='And'}
</label>
<label class="radio">
<input type="radio" name="type" value="2"> {intl l='Or'}
</label>
{if $noRules}
{include file='includes/notifications.html' message={intl l='Please save your Coupon in oder to affect it some application fields'}}
{else}
<section class="row">
<div class="col-md-12 general-block-decorator">
<table class="table table-striped">
<caption class="clearfix">
{intl l='Rules'}
</caption>
<thead>
<tr>
<th>{intl l='Conditions'}</th>
<th>{intl l='Actions'}</th>
</tr>
</thead>
<tbody id="constraint-list">
{include file='coupon/rules.html' rules=$rules}
</tbody>
</table>
</div>
</section>
<div id="rule-add-type" class="form-group col-md-4">
<label for="categoryRule">{intl l='Rule\'s category :'}</label>
<select name="categoryRule" id="category-rule" class="form-control">
{foreach from=$availableRules item=availableRule}
<option value="{$availableRule.serviceId}" data-description="{$availableRule.toolTip}">{$availableRule.name}</option>
{/foreach}
</select>
<section class="row">
<div class="col-md-12 general-block-decorator clearfix">
<a id="constraint-save-btn" title="{intl l='Save this rule'}" class="btn btn-default btn-primary pull-right">
<span class="glyphicon glyphicon-plus-sign"></span>
</a>
<div id="rule-add-organizer" class="form-group col-md-2">
<label for="type">{intl l='Condition type :'}</label>
<label class="radio">
<input type="radio" name="type" id="type" value="1" checked> {intl l='And'}
</label>
<label class="radio">
<input type="radio" name="type" value="2"> {intl l='Or'}
</label>
</div>
<div id="rule-add-type" class="form-group col-md-4">
<label for="categoryRule">{intl l='Rule\'s category :'}</label>
<select name="categoryRule" id="category-rule" class="form-control">
{foreach from=$availableRules item=availableRule}
<option value="{$availableRule.serviceId}" data-description="{$availableRule.toolTip}">{$availableRule.name}</option>
{/foreach}
</select>
</div>
<div id="constraint-add-operators-values" class="form-group col-md-6">
{*<label for="operator">{intl l='Operator :'}</label>*}
{*<div class="row">*}
{*<div class="col-lg-6">*}
{*<select name="operator" id="operator" class="form-control">*}
{*<option value="1">is superior to</option>*}
{*<option value="2">equals to</option>*}
{*<option value="3">is inferior to</option>*}
{*<option value="4">is inferior or equals to</option>*}
{*<option value="5">is superior or equals to</option>*}
{*</select>*}
{*</div>*}
{*<div class="input-group col-lg-6">*}
{*<input type="text" name="value" class="form-control">*}
{*<span class="input-group-addon">&euro;</span>*}
{*</div>*}
{*</div>*}
{**}
{*<label for="operator">Operator :</label>*}
{*<div class="row">*}
{*<div class="col-lg-6">*}
{*<select name="operator" id="operator" class="form-control">*}
{*<option value="1">is superior to</option>*}
{*<option value="2">equals to</option>*}
{*<option value="3">is inferior to</option>*}
{*<option value="4">is inferior or equals to</option>*}
{*<option value="5">is superior or equals to</option>*}
{*</select>*}
{*</div>*}
{*<div class="input-group col-lg-6 date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">*}
{*<input type="text" name="value" class="form-control">*}
{*<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>*}
{*</div>*}
{*</div>*}
{*<label for="operator">Operator :</label>*}
{*<div class="row">*}
{*<div class="col-lg-6">*}
{*<select name="operator" id="operator" class="form-control">*}
{*<option value="1">is superior to</option>*}
{*<option value="2">equals to</option>*}
{*<option value="3">is inferior to</option>*}
{*<option value="4">is inferior or equals to</option>*}
{*<option value="5">is superior or equals to</option>*}
{*</select>*}
{*</div>*}
{*<div class="col-lg-6">*}
{*<input type="text" name="value" class="form-control">*}
{*</div>*}
{*</div>*}
{*<div class="row">*}
{*<div class="col-lg-12">*}
{*<table class="table table-bordered">*}
{*<tr>*}
{*<td id="minibrowser-breadcrumb"></td>*}
{*</tr>*}
{*<tr>*}
{*<th><span class="icon-th-list"></span> Categories list</th>*}
{*</tr>*}
{*<tr>*}
{*<td id="minibrowser-categories"></td>*}
{*</tr>*}
{*</table>*}
{*</div>*}
{*</div>*}
</div>
</div>
<div id="constraint-add-operators-values" class="form-group col-md-6">
{*<label for="operator">{intl l='Operator :'}</label>*}
{*<div class="row">*}
{*<div class="col-lg-6">*}
{*<select name="operator" id="operator" class="form-control">*}
{*<option value="1">is superior to</option>*}
{*<option value="2">equals to</option>*}
{*<option value="3">is inferior to</option>*}
{*<option value="4">is inferior or equals to</option>*}
{*<option value="5">is superior or equals to</option>*}
{*</select>*}
{*</div>*}
{*<div class="input-group col-lg-6">*}
{*<input type="text" name="value" class="form-control">*}
{*<span class="input-group-addon">&euro;</span>*}
{*</div>*}
{*</div>*}
{**}
{*<label for="operator">Operator :</label>*}
{*<div class="row">*}
{*<div class="col-lg-6">*}
{*<select name="operator" id="operator" class="form-control">*}
{*<option value="1">is superior to</option>*}
{*<option value="2">equals to</option>*}
{*<option value="3">is inferior to</option>*}
{*<option value="4">is inferior or equals to</option>*}
{*<option value="5">is superior or equals to</option>*}
{*</select>*}
{*</div>*}
{*<div class="input-group col-lg-6 date" data-date="12/02/2012" data-date-format="dd/mm/yyyy">*}
{*<input type="text" name="value" class="form-control">*}
{*<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>*}
{*</div>*}
{*</div>*}
{*<label for="operator">Operator :</label>*}
{*<div class="row">*}
{*<div class="col-lg-6">*}
{*<select name="operator" id="operator" class="form-control">*}
{*<option value="1">is superior to</option>*}
{*<option value="2">equals to</option>*}
{*<option value="3">is inferior to</option>*}
{*<option value="4">is inferior or equals to</option>*}
{*<option value="5">is superior or equals to</option>*}
{*</select>*}
{*</div>*}
{*<div class="col-lg-6">*}
{*<input type="text" name="value" class="form-control">*}
{*</div>*}
{*</div>*}
{*<div class="row">*}
{*<div class="col-lg-12">*}
{*<table class="table table-bordered">*}
{*<tr>*}
{*<td id="minibrowser-breadcrumb"></td>*}
{*</tr>*}
{*<tr>*}
{*<th><span class="icon-th-list"></span> Categories list</th>*}
{*</tr>*}
{*<tr>*}
{*<td id="minibrowser-categories"></td>*}
{*</tr>*}
{*</table>*}
{*</div>*}
{*</div>*}
</div>
</div>
</section>
</section>
{/if}
</form>

View File

@@ -1,4 +1,3 @@
{*{$inputs.inputs|var_dump}*}
{foreach from=$inputs.inputs key=name item=input}
<label for="operator">{$input.title}</label>
<div class="row">
@@ -71,32 +70,33 @@
{*</div>*}
<script>
var ruleToSave = {};
ruleToSave['serviceId'] = '{$ruleId}';
ruleToSave['operators'] = {};
ruleToSave['values'] = {};
{foreach from=$inputs.inputs key=name item=input}
ruleToSave['operators']['{$name nofilter}'] = '{foreach from=$inputs.inputs[$name].availableOperators key=keyOperator item=valueOperator name=operators}{if $smarty.foreach.operators.first}{$keyOperator nofilter}{/if}{/foreach}';
ruleToSave['values']['{$name nofilter}'] = '{if count($inputs.inputs[$name].availableValues) != 0}{foreach from=$inputs.inputs[$name].availableValues key=keyValue item=valueValue name=values}{if $smarty.foreach.values.first}{$keyValue nofilter}{/if}{/foreach}{else}to set{/if}';
{/foreach}
// Init Rules to set
couponManager.ruleToSave['serviceId'] = '{$ruleId}';
couponManager.ruleToSave['operators'] = {literal}{}{/literal};
couponManager.ruleToSave['values'] = {literal}{}{/literal};
{foreach from=$inputs.inputs key=name item=input}
couponManager.ruleToSave['operators']['{$name nofilter}'] = '{foreach from=$inputs.inputs[$name].availableOperators key=keyOperator item=valueOperator name=operators}{if $smarty.foreach.operators.first}{$keyOperator nofilter}{/if}{/foreach}';
couponManager.ruleToSave['values']['{$name nofilter}'] = '{if count($inputs.inputs[$name].availableValues) != 0}{foreach from=$inputs.inputs[$name].availableValues key=keyValue item=valueValue name=values}{if $smarty.foreach.values.first}{$keyValue nofilter}{/if}{/foreach}{else}to set{/if}';
{/foreach}
// Update ruleToSave Array ready to be saved
var onInputsChange = function() {literal}{{/literal}
{foreach from=$inputs.inputs key=name item=input}
$('#{$name}-operator').change(function (e) {
var $this = $(this);
ruleToSave['operators']['{$name nofilter}'] = $this.val();
console.log('#{$name}-operator changed ' + $this.val());
console.log(ruleToSave);
});
$('#{$name}-value').change(function (e) {
var $this = $(this);
ruleToSave['values']['{$name nofilter}'] = $this.val();
console.log('#{$name}-value changed ' + $this.val());
console.log(ruleToSave);
});
{/foreach}
// Fill in ready to be saved rule array
couponManager.onInputsChange = function() {literal}{{/literal}
{foreach from=$inputs.inputs key=name item=input}
// Operator selector
$('#{$name}-operator').change(function (e) {
console.log('changin operator');
var $this = $(this);
couponManager.ruleToSave['operators']['{$name nofilter}'] = $this.val();
});
// Value input
$('#{$name}-value').change(function (e) {
console.log('changin value');
var $this = $(this);
couponManager.ruleToSave['values']['{$name nofilter}'] = $this.val();
});
{/foreach}
{literal}}{/literal}
onInputsChange();
couponManager.onInputsChange();
</script>

View File

@@ -1,4 +1,4 @@
{foreach from=$rules item=rule name=rulesForeach}
{foreach from=$rules item=rule key=i name=rulesForeach}
<tr>
<td>
{if !$smarty.foreach.rulesForeach.first}
@@ -7,10 +7,10 @@
{$rule nofilter}
</td>
<td>
<a class="btn btn-default btn-primary btn-medium" href="{$urlEdit}">
<a data-int="{$i}" class="btn btn-default btn-primary btn-medium constraint-update-btn" href="{$urlEdit}">
<span class="glyphicon glyphicon-edit"></span> {intl l='Edit'}
</a>
<a data-target="#delete" data-toggle="confirm" class="btn btn-default btn-danger btn-medium" href="{$urlDelete}">
<a data-int="{$i}" data-target="#delete" data-toggle="confirm" class="btn btn-default btn-danger btn-medium constraint-delete-btn" href="{$urlDelete}">
<span class="glyphicon glyphicon-remove"></span> {intl l='Delete'}
</a>
</td>

View File

@@ -28,13 +28,13 @@
{form_field form=$form field='username'}
<span {if $error}class="error"{/if}>
<input type="text" class="input" placeholder="{intl l='User name'}" name="{$name}" value="{$value}" {$attr} />
<input type="text" id="username" class="input" placeholder="{intl l='User name'}" name="{$name}" value="{$value}" {$attr} />
</span>
{/form_field}
{form_field form=$form field='password'}
<span {if $error}class="error"{/if}>
<input type="password" class="input" placeholder="{intl l='Password'}" name="{$name}" {$attr} />
<input type="password" id="password" class="input" placeholder="{intl l='Password'}" name="{$name}" {$attr} />
</span>
{/form_field}

View File

@@ -34,10 +34,8 @@
<li class="item">
<article itemscope itemtype="http://schema.org/Product">
<!-- Use the meta tag to specify content that is not visible on the page in any way -->
<meta itemprop="manufacturer" content="Diesel">
<meta itemprop="category" content="Category1">
<meta itemprop="condition" content="new"> <!-- List of condition : new, used, refurbished -->
<meta itemprop="identifier" content="mpn:925872"> <!-- List of identifier : asin, isbn, mpn, upc, sku -->
<meta itemprop="brand" content="Diesel">
<meta itemprop="productID" content="isbn:925872">
<a href="{$URL}" itemprop="url" tabindex="-1" class="product-image">
{ifloop rel="image_product_new" }
@@ -59,8 +57,11 @@
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="currency" content="{currency attr="code"}"> <!-- List of currency : The currency used to describe the product price, in three-letter ISO format. -->
<link itemprop="availability" href="http://schema.org/InStock" content="In Stock" />
<meta itemprop="category" content="Category1">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
<meta itemprop="priceCurrency" content="{currency attr="code"}"> <!-- List of currency : The currency used to describe the product price, in three-letter ISO format. -->
<link itemprop="availability" href="http://schema.org/InStock" content="in_stock" />
<!-- List of availibility :
out_of_stock : http://schema.org/OutOfStock
in_stock : http://schema.org/InStock
@@ -92,10 +93,8 @@
<li class="item">
<article itemscope itemtype="http://schema.org/Product">
<!-- Use the meta tag to specify content that is not visible on the page in any way -->
<meta itemprop="manufacturer" content="Diesel">
<meta itemprop="category" content="Category1">
<meta itemprop="condition" content="new"> <!-- List of condition : new, used, refurbished -->
<meta itemprop="identifier" content="mpn:925872"> <!-- List of identifier : asin, isbn, mpn, upc, sku -->
<meta itemprop="brand" content="Diesel">
<meta itemprop="productID" content="isbn:925872">
<a href="{$URL}" itemprop="url" tabindex="-1" class="product-image">
{ifloop rel="image_product_promo" }
@@ -117,8 +116,10 @@
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="currency" content="USD"> <!-- List of currency : The currency used to describe the product price, in three-letter ISO format. -->
<link itemprop="availability" href="http://schema.org/InStock" content="In Stock" />
<meta itemprop="category" content="Category1">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
<meta itemprop="priceCurrency" content="{currency attr="code"}"> <!-- List of currency : The currency used to describe the product price, in three-letter ISO format. -->
<link itemprop="availability" href="http://schema.org/InStock" content="in_stock" />
<!-- List of availibility :
out_of_stock : http://schema.org/OutOfStock
in_stock : http://schema.org/InStock

View File

@@ -84,8 +84,15 @@ URL: http://www.thelia.net
{/loop}
</ul>
<ul class="nav navbar-nav navbar-cart navbar-right">
{loop type="auth" name="customer_info_block" roles="CUSTOMER" context="front"}
<li><a href="{url path="/logout"}" class="register">{intl l="Log out!"}</a></li>
<li><a href="{url path="/customer/account"}" class="login">{intl l="My Account"}</a></li>
{/loop}
{elseloop rel="customer_info_block" rel="customer_info_block"}
<li><a href="{url path="/register"}" class="register">{intl l="Register"}!</a></li>
<li><a href="{url path="/login"}" class="login">{intl l="Log In!"}</a></li>
{/elseloop}
<li class="dropdown">
<a href="cart.html" class="dropdown-toggle cart" data-toggle="dropdown">
Cart <span class="badge">2</span>
@@ -113,7 +120,7 @@ URL: http://www.thelia.net
<div class="input-group">
<input type="search" name="q" id="q" placeholder="Search..." class="form-control" aria-required="true" required pattern=". { 2,}" title="Minmimum 2 characters.">
<div class="input-group-btn">
<button type="submit" class="btn btn-search"><span class="icon-search"></span> <span>Search</span></button>
<button type="submit" class="btn btn-search"><i class="icon-search"></i> <span>Search</span></button>
</div>
</div>
</form>

View File

@@ -4,7 +4,7 @@
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
<strong id="breadcrumb-label">{intl l="You are here"}: </strong>
<ul class="breadcrumb" itemprop="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="index.php" itemprop="url"><span itemprop="title">{intl l="Home"}</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{url path="/"}" itemprop="url"><span itemprop="title">{intl l="Home"}</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">{intl l="Login"}</span></li>
</ul>
</nav><!-- /.nav-breadcrumb -->
@@ -67,7 +67,7 @@
</fieldset>
<div class="group-btn">
<a href="{url path="/customer/password"}" class="forgot-password">{intl l="Forgot your Password ?"}</a>
<a href="{url path="/password"}" class="forgot-password">{intl l="Forgot your Password ?"}</a>
<button type="submit" class="btn btn-login">{intl l="Next"}</button>
</div>
</form>

View File

@@ -0,0 +1,42 @@
{extends file="layout.tpl"}
{block name="breadcrumb"}
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
<strong id="breadcrumb-label">{intl l="You are here"} </strong>
<ul class="breadcrumb" itemprop="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{url path="/"}" itemprop="url"><span itemprop="title">{intl l="Home"}</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">{intl l="Password"}</span></li>
</ul>
</nav><!-- /.nav-breadcrumb -->
{/block}
{block name="main-content"}
<div class="main">
<article class="col-main" role="main" aria-labelledby="main-label">
<h1 id="main-label" class="page-header">{intl l="Password Forgotten"}</h1>
{form name="thelia.customer.lostpassword"}
<form id="form-forgotpassword" action="{url path="/password"}" method="post" role="form">
<p>{intl l="Please enter your email address below." {intl l="You will receive a link to reset your password."}</p>
{form_field form=$form field="email"}
<div class="form-group group-email {if $error}has-error{elseif !$error && $value != ""}has-success{/if}">
<label for="{$label_attr.for}">{$label}</label>
<div class="control-input">
<input type="email" name="{$name}" value="{$value}" id="{$label_attr.for}" class="form-control" aria-required="true" autofocus required>
{if $error}
<span class="help-block"><span class="icon-remove"></span> {$message}</span>
{elseif !$error && $value != ""}
<span class="help-block"><span class="icon-ok"></span> {intl l="You will receive a link to reset your password."}</span>
{/if}
</div>
</div>
{/form_field}
<div class="group-btn">
<a href="{url path="/"}" class="btn btn-cancel">{intl l="Cancel"}</a>
<button type="submit" class="btn btn-forgot">{intl l="Send"}</button>
</div>
</form>
{/form}
</article>
</div>
{/block}

View File

@@ -4,7 +4,7 @@
<nav class="nav-breadcrumb" role="navigation" aria-labelledby="breadcrumb-label">
<strong id="breadcrumb-label">{intl l="You are here"}: </strong>
<ul class="breadcrumb" itemprop="breadcrumb">
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="index.php" itemprop="url"><span itemprop="title">{intl l="Home"}</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb"><a href="{url path="/"}" itemprop="url"><span itemprop="title">{intl l="Home"}</span></a></li>
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="active"><span itemprop="title">{intl l="Register"}</span></li>
</ul>
</nav><!-- /.nav-breadcrumb -->
@@ -19,18 +19,44 @@
<h1 id="main-label" class="page-header">{intl l="Create New Account"}</h1>
{form name="thelia.customer.creation"}
<form id="form-register" class="form-horizontal" action="{url path="/customer/create"}" method="post" role="form">
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{navigate to="return_to"}" /> {* the url the user is redirected to on login success *}
{/form_field}
{form_field form=$form field='error_message'}
<input type="hidden" name="{$name}" value="{intl l="missing or invalid data"}" /> {* the url the user is redirected to on login success *}
{/form_field}
{form_hidden_fields form=$form}
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<fieldset id="register-info" class="panel panel">
<div class="panel-heading">
1. {intl l="Personal Informations"}
</div>
<div class="panel-body">
{form_field form=$form field="title"}
<div class="form-group group-title {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<select name="{$name}" id="{$label_attr.for}" class="form-control" required autofocus>
<option value="">-- {intl l="Select Title"} --</option>
{loop type="title" name="country.list"}
<option value="{$ID}" {if $value == $ID}selected{/if} >{$LONG}</option>
{/loop}
</select>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
{form_field form=$form field="firstname"}
<div class="form-group group-firstname {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
<div class="form-group group-firstname {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus required>
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" required>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
@@ -40,7 +66,7 @@
</div><!--/.form-group-->
{/form_field}
{form_field form=$form field="lastname"}
<div class="form-group group-lastname {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
<div class="form-group group-lastname {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus required>
@@ -53,7 +79,7 @@
</div><!--/.form-group-->
{/form_field}
{form_field form=$form field="email"}
<div class="form-group group-email {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
<div class="form-group group-email {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
@@ -67,7 +93,7 @@
</div><!--/.form-group-->
{/form_field}
{form_field form=$form field="phone"}
<div class="form-group group-phone {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
<div class="form-group group-phone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label}</label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus>
@@ -80,7 +106,7 @@
</div><!--/.form-group-->
{/form_field}
{form_field form=$form field="cellphone"}
<div class="form-group group-cellphone {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
<div class="form-group group-cellphone {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label}</label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus>
@@ -101,74 +127,129 @@
</div>
<div class="panel-body">
<div class="form-group group-company">
<label class="control-label" for="company">Company Name: <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="company" id="company" class="form-control" placeholder="Thelia" required>
</div>
</div><!--/.form-group-->
{form_field form=$form field="company"}
<div class="form-group group-company {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label}</label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="Thelia" value="{$value}" autofocus>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
<div class="form-group group-address">
<label class="control-label" for="address">Street Address: <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="asresss" id="address" class="form-control" placeholder="Street address" required>
</div>
</div><!--/.form-group-->
{form_field form=$form field="address1"}
<div class="form-group group-address1 {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="{$label}" value="{$value}" autofocus required>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
<div class="form-group group-address_2">
<label class="control-label" for="address_2">Address 2:</label>
<div class="control-input">
<input type="text" name="address_2" id="address_2" class="form-control" placeholder="">
</div>
</div><!--/.form-group-->
{form_field form=$form field="address2"}
<div class="form-group group-address2 {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label}</label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="" value="{$value}" autofocus>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
<div class="form-group group-city">
<label class="control-label" for="city">City: <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="city" id="city" class="form-control" placeholder="New york" required>
</div>
</div><!--/.form-group-->
{form_field form=$form field="city"}
<div class="form-group group-city {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="New York" value="{$value}" autofocus required>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
<div class="form-group group-zip">
<label class="control-label" for="zip">Postal Code: <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="zip" id="zip" class="form-control" placeholder="H2T 2V6" required>
</div>
</div><!--/.form-group-->
{form_field form=$form field="zipcode"}
<div class="form-group group-zip {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="H2T 2V6" value="{$value}" autofocus required>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
<div class="form-group group-country">
<label class="control-label" for="country">Country: <span class="required">*</span></label>
<div class="control-input">
<select name"country" id="country" class="form-control" required>
<option value="">-- Select Country --</option>
<option value="1">Country1</option>
<option value="2">Country2</option>
<option value="3">Country3</option>
<option value="4">Country4</option>
</select>
</div>
</div><!--/.form-group-->
{form_field form=$form field="country"}
<div class="form-group group-country {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<select name="{$name}" id="{$label_attr.for}" class="form-control" required>
<option value="">-- {intl l="Select Country"} --</option>
{loop type="country" name="country.list"}
<option value="{$ID}" {if $value == $ID}selected{/if} >{$TITLE}</option>
{/loop}
</select>
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
</div>
</fieldset>
<fieldset id="register-login" class="panel">
<div class="panel-heading">
3. Login Information
3. {intl l="Login Information"}
</div>
<div class="panel-body">
<div class="form-group group-password">
<label class="control-label" for="password">Password: <span class="required">*</span></label>
<div class="control-input">
<input type="password" name="password" id="password" class="form-control" required autocomplete="off">
</div>
</div><!--/.form-group-->
{form_field form=$form field="password"}
<div class="form-group group-password {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" required autocomplete="off">
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
<div class="form-group group-confirm_password">
<label class="control-label" for="confirm_password">Confirm Password: <span class="required">*</span></label>
<div class="control-input">
<input type="password" name="confirm_password" id="confirm_password" class="form-control" required autocomplete="off">
</div>
</div><!--/.form-group-->
{form_field form=$form field="password_confirm"}
<div class="form-group group-password_confirm {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
<div class="control-input">
<input type="password" name="{$name}" id="{$label_attr.for}" class="form-control" required autocomplete="off">
{if $error }
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
{elseif $value != "" && !$error}
<span class="help-block"><i class="icon-ok"></i></span>
{/if}
</div>
</div><!--/.form-group-->
{/form_field}
</div>
</fieldset>
@@ -176,7 +257,7 @@
<div class="control-input">
<div class="checkbox">
<label class="control-label" for="agreed">
<input type="checkbox" name="agreed" id="agreed" value="1"> I've read and agreed on <a href="#">Terms &amp; Conditions</a>.
<input type="checkbox" name="agreed" id="agreed" value="1" required> I've read and agreed on <a href="#">Terms &amp; Conditions</a>.
</label>
</div>
</div>

View File

@@ -1,9 +1,3 @@
<html>
<head>
{debugbar_renderHead}
</head>
<body>
<h1>Category page</h1>
<div style="border: solid 8px; margin: 0px; padding: 0px; width: 45%; float: left">
@@ -148,8 +142,4 @@
{/loop}
</ul>
</div>
{debugbar_render}
</body>
</html>
</div>

View File

@@ -8,7 +8,7 @@ Index : {navigate to="index"}<br />
{ifloop rel="product"}
{loop type="product" name="product" current="true" min_price="50" max_price="100"}
{loop type="product" name="product" current="true"}
<div style="border: dashed 2px red; padding: 20px; margin: 10px;">
<h2>PRODUCT ({$ID}) : {$REF}</h2>
@@ -68,7 +68,7 @@ Index : {navigate to="index"}<br />
{$ATTRIBUTE_TITLE} = {$ATTRIBUTE_AVAILABILITY_TITLE}<br />
{/loop}
<br />{$WEIGHT} g
<br /><strong>{if $IS_PROMO == 1} {$PROMO_PRICE} {currency attr="symbol"} HT // TAX : {$PROMO_PRICE_TAX} ; {$TAXED_PROMO_PRICE} {currency attr="symbol"} TTC (instead of {$PRICE_HT} // TAX : {$PRICE_TAX} ; {$TAXED_PRICE} {currency attr="symbol"} TTC){else} {$PRICE} {currency attr="symbol"} HT // TAX : {$PRICE_TAX} ; {$TAXED_PRICE} {currency attr="symbol"} TTC{/if}</strong>
<br /><strong>{if $IS_PROMO == 1} {$PROMO_PRICE} {currency attr="symbol"} HT // TAX : {$PROMO_PRICE_TAX} ; {$TAXED_PROMO_PRICE} {currency attr="symbol"} TTC (instead of {$PRICE} HT // TAX : {$PRICE_TAX} ; {$TAXED_PRICE} {currency attr="symbol"} TTC){else} {$PRICE} {currency attr="symbol"} HT // TAX : {$PRICE_TAX} ; {$TAXED_PRICE} {currency attr="symbol"} TTC{/if}</strong>
<br /><br />
Add
<select>