Merge branch 'master' into loops

This commit is contained in:
Etienne Roudeix
2013-07-23 10:44:41 +02:00
218 changed files with 4272 additions and 3653 deletions

View File

@@ -235,4 +235,162 @@ hr {
border: 1px solid #e5e5e5;
.border-radius;
.box-shadow;
}
// -- Allow inline forms validation states ------------------------------------
.form-inline .warning .control-label,
.form-inline .warning .help-block,
.form-inline .warning .help-inline {
color: #c09853;
}
.form-inline .warning .checkbox,
.form-inline .warning .radio,
.form-inline .warning input,
.form-inline .warning select,
.form-inline .warning textarea {
color: #c09853;
}
.form-inline .warning input,
.form-inline .warning select,
.form-inline .warning textarea {
border-color: #c09853;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.form-inline .warning input:focus,
.form-inline .warning select:focus,
.form-inline .warning textarea:focus {
border-color: #a47e3c;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #dbc59e;
}
.form-inline .warning .input-prepend .add-on,
.form-inline .warning .input-append .add-on {
color: #c09853;
background-color: #fcf8e3;
border-color: #c09853;
}
.form-inline .error .control-label,
.form-inline .error .help-block,
.form-inline .error .help-inline {
color: #b94a48;
}
.form-inline .error .checkbox,
.form-inline .error .radio,
.form-inline .error input,
.form-inline .error select,
.form-inline .error textarea {
color: #b94a48;
}
.form-inline .error input,
.form-inline .error select,
.form-inline .error textarea {
border-color: #b94a48;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.form-inline .error input:focus,
.form-inline .error select:focus,
.form-inline .error textarea:focus {
border-color: #953b39;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #d59392;
}
.form-inline .error .input-prepend .add-on,
.form-inline .error .input-append .add-on {
color: #b94a48;
background-color: #f2dede;
border-color: #b94a48;
}
.form-inline .success .control-label,
.form-inline .success .help-block,
.form-inline .success .help-inline {
color: #468847;
}
.form-inline .success .checkbox,
.form-inline .success .radio,
.form-inline .success input,
.form-inline .success select,
.form-inline .success textarea {
color: #468847;
}
.form-inline .success input,
.form-inline .success select,
.form-inline .success textarea {
border-color: #468847;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.form-inline .success input:focus,
.form-inline .success select:focus,
.form-inline .success textarea:focus {
border-color: #356635;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7aba7b;
}
.form-inline .success .input-prepend .add-on,
.form-inline .success .input-append .add-on {
color: #468847;
background-color: #dff0d8;
border-color: #468847;
}
.form-inline .info .control-label,
.form-inline .info .help-block,
.form-inline .info .help-inline {
color: #3a87ad;
}
.form-inline .info .checkbox,
.form-inline .info .radio,
.form-inline .info input,
.form-inline .info select,
.form-inline .info textarea {
color: #3a87ad;
}
.form-inline .info input,
.form-inline .info select,
.form-inline .info textarea {
border-color: #3a87ad;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
}
.form-inline .info input:focus,
.form-inline .info select:focus,
.form-inline .info textarea:focus {
border-color: #2d6987;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
-moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #7ab5d3;
}
.form-inline .info .input-prepend .add-on,
.form-inline .info .input-append .add-on {
color: #3a87ad;
background-color: #d9edf7;
border-color: #3a87ad;
}

View File

@@ -1,4 +1,4 @@
{check_auth roles="ADMIN"}
{check_auth context="admin" roles="ADMIN" login_tpl="/admin/login"}
{$page_title={intl l='Home'}}
{include file='includes/header.inc.html'}

View File

@@ -1,7 +1,7 @@
<hr />
<footer class="modal-footer">
<div class="container">
<p>{intl l='&copy; Thelia 2012'}
<p>{intl l='&copy; Thelia 2013'}
- <a href="http://www.openstudio.fr/" target="_blank">{intl l='Édité par OpenStudio'}</a>
- <a href="http://forum.thelia.net/" target="_blank">{intl l='Forum Thelia'}</a>
- <a href="http://contrib.thelia.net/" target="_blank">{intl l='Contributions Thelia'}</a>

View File

@@ -13,24 +13,36 @@
<div class="hero-unit">
<h1>{intl l='Thelia Back Office'}</h1>
<form action="admin/login" method="post" class="well form-inline" {form_enctype form=$form}>
{form_field_hidden form=$form}
{form_field form=$form.username}
{form_error form=$form.username}
{$message}
{/form_error}
<input type="text" class="input" placeholder="{intl l='E-mail address'}" name="{$name}" />
{/form_field}
{form_field form=$form.password}
<input type="password" class="input" placeholder="{intl l='Password'}" name="{$name}" />
{/form_field}
{form name="thelia.admin.login" success_url="home" error_url="login"}
<form action="{url path='/admin/checklogin'}" method="post" class="well form-inline" {form_enctype form=$form}>
{form_field form=$form.remember_me}
<label class="checkbox"> <input type="checkbox" name="remember" value="yes"> {intl l='Remember me'}</label>
{if isset($message)}<div class="alert alert-error">{$message}</div>{/if}
{form_hidden_fields form=$form}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin'}" /> {* on success, redirect to /admin *}
{/form_field}
<div class="pull-right"><button type="submit" class="btn btn-primary">{intl l='Login'} <i class="icon-play icon-white"></i></button></div>
{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} />
</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} />
</span>
{/form_field}
{form_field form=$form field='remember_me'}
<label class="checkbox"> <input type="checkbox" name="{$name}" value="{$value}" {$attr} {if $options.checked}checked="checked"{/if}/> {intl l='Remember me'}</label>
{/form_field}
<span class="pull-right"><button type="submit" class="btn btn-primary">{intl l='Login'} <i class="icon-play icon-white"></i></button></span>
</form>
{/form}
</div>
{module_include location='index_middle'}

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View File

@@ -1,12 +1,36 @@
{include file="includes/header.html"}
{form name="thelia.customer.creation"}
<form method="post" action="index_dev.php?action=createCustomer&view=connexion" {form_enctype form=$form} >
{* We use $INDEX_PAGE as form action to avoid mixing post and get data *}
<form action="{$INDEX_PAGE}" method="post" {form_enctype form=$form}>
{*
The two fields below are not par of the Login form, they are here to defines
the action to process, and the view to render once the form is submited
*}
<input type="hidden" name="action" value="createCustomer" /> {* the action triggered by this form *}
<input type="hidden" name="view" value="connexion" /> {* the view to return to if the form cannot be validated *}
{form_field_hidden form=$form}
{*
This field is common to all BaseForm instances (thus, this one), and defines
the URL the customer is redirected to once the form has been successfully
processed
*}
{form_field form=$form.title}
{form_error form=$form.title}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{$RETURN_TO_URL}" /> {* the url the user is redirected to on login success *}
{/form_field}
{*
customer_creation_error_message is defined in Customer action processor class,
and passed the parser through the ParserContext service.
*}
{if isset($customer_creation_error_message)}<div class="alert alert-error">{$customer_creation_error_message}</div>{/if}
{form_hidden_fields form=$form}
{form_field form=$form field="title"}
{form_error form=$form field="title"}
{$message}
{/form_error}
@@ -19,64 +43,64 @@
<br />
{/form_field}
{form_field form=$form.firstname}
{form_error form=$form.firstname}
{form_field form=$form field="firstname"}
{form_error form=$form field="firstname"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.lastname}
{form_error form=$form.lastname}
{form_field form=$form field="lastname"}
{form_error form=$form field="lastname"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.address1}
{form_error form=$form.address1}
{form_field form=$form field="address1"}
{form_error form=$form field="address1"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.address2}
{form_error form=$form.address2}
{form_field form=$form field="address2"}
{form_error form=$form field="address2"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.address3}
{form_error form=$form.address3}
{form_field form=$form field="address3"}
{form_error form=$form field="address3"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.zipcode}
{form_error form=$form.zipcode}
{form_field form=$form field="zipcode"}
{form_error form=$form field="zipcode"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.city}
{form_error form=$form.city}
{form_field form=$form field="city"}
{form_error form=$form field="city"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr} > <br />
{/form_field}
{form_field form=$form.country}
{form_error form=$form.country}
{form_field form=$form field="country"}
{form_error form=$form field="country"}
{$message}
{/form_error}
@@ -89,43 +113,43 @@
<br />
{/form_field}
{form_field form=$form.phone}
{form_error form=$form.phone}
{form_field form=$form field="phone"}
{form_error form=$form field="phone"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
{/form_field}
{form_field form=$form.cellphone}
{form_error form=$form.cellphone}
{form_field form=$form field="cellphone"}
{form_error form=$form field="cellphone"}
{$message}
{/form_error}
<label> <span>{intl l="{$label}"} : </span></label><input type="text" name="{$name}" value="{$value}" {$attr}> <br />
{/form_field}
{form_field form=$form.email}
{form_error form=$form.email}
{form_field form=$form field="email"}
{form_error form=$form field="email"}
{#message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="email" name="{$name}" value="{$value}" {$attr} ><br />
{/form_field}
{form_field form=$form.email_confirm}
{form_error form=$form.email_confirm}
{form_field form=$form field="email_confirm"}
{form_error form=$form field="email_confirm"}
{#message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="email" name="{$name}" {$attr} ><br />
{/form_field}
{form_field form=$form.password}
{form_error form=$form.password}
{form_field form=$form field="password"}
{form_error form=$form field="password"}
{#message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="password" name="{$name}" {$attr} ><br />
{/form_field}
{form_field form=$form.password_confirm}
{form_error form=$form.password_confirm}
{form_field form=$form field="password_confirm"}
{form_error form=$form field="password_confirm"}
{#message}
{/form_error}
<label><span>{intl l="{$label}"}</span></label><input type="password" name="{$name}" {$attr} ><br />

View File

@@ -1,2 +0,0 @@
include 1 success<br />
#INCLUDE "subinclude1.html"

View File

@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<title>{$page_title|default:{intl l="Thelia II"}}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
{stylesheets file='../assets/css/*' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
</head>
<body>
<div>
{loop type="auth" name="customer_info_block" roles="CUSTOMER" context="front"}
<p>Your are logged in ! <a href="{viewurl view='index' action='logoutCustomer'}">Logout</a></p>
{/loop}
{loop type="auth" name="admin_info_block" roles="ADMIN" context="admin"}
<p>You are logged as administrator</p>
{/loop}
{elseloop rel="customer_info_block"}
You are not logged in. <a href="{viewurl view='login'}">Login now</a> or <a href="{viewurl view='connexion'}">create your account</a>
{/elseloop}
</div>
<hr />

View File

@@ -1,26 +1,151 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>TODO write content<br />
<THELIA_cat type="category">
#__COUNT__ - #TITLE <br />
nb child : #NB_CHILD <br /><br />
</THELIA_cat>
{include file="includes/header.html"}
<div>
<TEST_equal test="equal" variable="3" value="1">
test vrai
</TEST_equal>
test faux
<//TEST_equal>
<br />
<REPEAT_loopy start="6" end="12" increment="1">
Compteur = #INDEX<br />
</REPEAT_loopy>
{loop type="auth" name="auth_test" context="front" roles="CUSTOMER"}
</div>
</body>
</html>
<p>Customer is authentified :-)</p>
{/loop}
{elseloop rel="auth_test"}
<p>Customer is not authentified :-(</p>
{/elseloop}
An image from asset directory :
{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}
</div>
<div>
{intl l='An internationalized string'}
</div>
<div>
jQuery data: <span id="jquery_block"></span>
</div>
<div>
<p>Category loop example</p>
<ul>
{loop type="category" name="catloop1"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}, children: {$NB_CHILD}
{ifloop rel="inner1"}
<ul>
{loop type="category" name="inner1" parent="{$ID}"}
<li>Sub cat {$ID} (parent is {$PARENT}): {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
</li>
{/loop}
</ul>
</div>
<div>
<p>Conditional example #1</p>
{ifloop rel="catloop2"}
Hey ! Loop catloop2 is not empty:
<ul>
{loop type="category" name="catloop2" parent="12"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="catloop2"}
<p>Loop catloop2 is empty</p>
{/elseloop}
</div>
<div>
<p>Conditional example #2</p>
{ifloop rel="catloop3"}
Loop catloop3 is not empty:
<ul>
{loop type="category" name="catloop3" parent="0"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="catloop3"}
<p>Loop catloop3 is empty</p>
{/elseloop}
{elseloop rel="catloop2"}
<p>... but catloop2 is still empty :-)</p>
{/elseloop}
</div>
<div>
<p>Traditional for loop</p>
{for $index=5 to 12 step 1}
Compteur = {$index}<br />
{/for}
</div>
<div>
<p>Some pagination</p>
<p>PAGE 1</p>
<ul>
{loop type="category" name="catloopwithpagination1" limit="2" page="1"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>PAGE 2</p>
<ul>
{loop type="category" name="catloopwithpagination2" limit="2" page="2"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>PAGE 1000</p>
<ul>
{loop type="category" name="catloopwithpagination1000" limit="2" page="1000"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
{elseloop rel="catloopwithpagination1000"}
NO RESULTS
{/elseloop}
</ul>
</div>
<div>
<p>Some pagination with page choice</p>
{assign var=current_page value=2}
<p>PAGE {$current_page} :</p>
<ul>
{loop type="category" name="catloopwithpaginationchoice" limit="2" page="{$current_page}"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>page choice</p>
{pageloop rel="catloopwithpaginationchoice"}
{if ${PAGE} != {$current_page}}
{if {$PAGE} > {$current_page}-10 AND {$PAGE} < {$current_page}+10}
{$PAGE}
{/if}
{if {$PAGE} == {$current_page}-10 OR {$PAGE} == {$current_page}+10}
...
{/if}
{if ({$PAGE} < {$current_page}-10 OR {$PAGE} > {$current_page}+10) AND ({$PAGE}%10 == 0 OR ${PAGE} == {$LAST} OR ${PAGE} == 1)}
{$PAGE}
{/if}
{else}
{ {$PAGE} }
{/if}
{if {$PAGE} != {$LAST}}
-
{/if}
{/pageloop}
</div>
{include file="includes/footer.html"}

View File

@@ -0,0 +1,52 @@
{include file="includes/header.html"}
<h1>{intl l='Please login'}</h1>
{form name="thelia.customer.login" }
{* We use $INDEX_PAGE as form action to avoid mixing post and get data *}
<form action="{$INDEX_PAGE}" method="post" {form_enctype form=$form}>
{*
The two fields below are not par of the Login form, they are here to defines
the action to process, and the view to render once the form is submited
*}
<input type="hidden" name="action" value="loginCustomer" /> {* the action triggered by this form *}
<input type="hidden" name="view" value="login" /> {* the view to return to if the form cannot be validated *}
{*
This field is common to all BaseForm instances (thus, this one), and defines
the URL the customer is redirected to once the form has been successfully
processed
*}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{$RETURN_TO_URL}" /> {* the url the user is redirected to on login success *}
{/form_field}
{*
customer_login_error_message is defined in Customer action processor class,
and passed the parser through the ParserContext service.
*}
{if isset($customer_login_error_message)}<div class="alert alert-error">{$customer_login_error_message}</div>{/if}
{form_hidden_fields form=$form}
{form_field form=$form field="email"}
{if #error}{#message}{/if}
<label>{intl l="Your e-mail address"}: </label><input type="email" name="{$name}" {$attr} ><br />
{/form_field}
{form_field form=$form field='password'}
<label>{intl l="Your password"}: </label><input type="password" name="{$name}" {$attr}> <br />
{/form_field}
{form_field form=$form field='remember_me'}
<label class="checkbox"> <input type="checkbox" name="{$name}" value="{$value}" {$attr} {if $options.checked}checked="checked"{/if}/> {intl l='Remember me'}</label>
{/form_field}
<button type="submit">{intl l='Login'}</button>
</form>
{/form}
{include file='includes/footer.html'}

View File

@@ -0,0 +1,6 @@
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
{$page_title="{intl l='My Account'}"}
{include file="includes/header.html"}
{include file="includes/footer.html"}

View File

@@ -1 +0,0 @@
subinclude1 success

View File

@@ -1,13 +0,0 @@
{* Include required JS files *}
{javascripts file='../assets/js/jquery.min.js'}
<link rel="stylesheet" href="{$asset_url}" target="screen">
{/javascripts}
{javascripts file='../assets/bootstrap/js/bootstrap.min.js'}
<link rel="stylesheet" href="{$asset_url}" target="screen">
{/javascripts}
{* TODO allow modules to include JS here *}
</body>
</html>

View File

@@ -1,11 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{intl l='Hi, I\'m a Thelia TPex template'}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
{stylesheets file='../assets/css/*' filters='less,cssembed'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
</head>
<body>

View File

@@ -1,21 +0,0 @@
<!DOCTYPE html>
<html lang="{$lang}">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{stylesheets file='../assets/css/*' filters='less,cssrewrite'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{stylesheets file='../assets/bootstrap/css/bootstrap.min.css' filters='cssrewrite'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{stylesheets file='../assets/bootstrap/css/bootstrap-responsive.min.css' filters='cssrewrite'}
<link rel="stylesheet" href="{$asset_url}">
{/stylesheets}
{* TODO allow modules to include CSS here *}
</head>
<body>

View File

@@ -1,150 +0,0 @@
{include file="includes/header.html"}
<div>
{loop type="auth" name="auth_test" roles="CUSTOMER"}
<p>Customer is authentified :-)</p>
{/loop}
{elseloop rel="auth_test"}
<p>Customer is not authentified :-(</p>
{/elseloop}
An image from asset directory :
{images file='assets/img/logo-thelia-34px.png'}<img src="{$asset_url}" alt="{intl l='Thelia, solution e-commerce libre'}" />{/images}
</div>
<div>
{intl l='An internationalized string'}
</div>
<div>
jQuery data: <span id="jquery_block"></span>
</div>
<div>
<p>Category loop example</p>
<ul>
{loop type="category" name="catloop1"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}, children: {$NB_CHILD}
{ifloop rel="inner1"}
<ul>
{loop type="category" name="inner1" parent="{$ID}"}
<li>Sub cat {$ID} (parent is {$PARENT}): {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
</li>
{/loop}
</ul>
</div>
<div>
<p>Conditional example #1</p>
{ifloop rel="catloop2"}
Hey ! Loop catloop2 is not empty:
<ul>
{loop type="category" name="catloop2" parent="12"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="catloop2"}
<p>Loop catloop2 is empty</p>
{/elseloop}
</div>
<div>
<p>Conditional example #2</p>
{ifloop rel="catloop3"}
Loop catloop3 is not empty:
<ul>
{loop type="category" name="catloop3" parent="0"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="catloop3"}
<p>Loop catloop3 is empty</p>
{/elseloop}
{elseloop rel="catloop2"}
<p>... but catloop2 is still empty :-)</p>
{/elseloop}
</div>
<div>
<p>Traditional for loop</p>
{for $index=5 to 12 step 1}
Compteur = {$index}<br />
{/for}
</div>
<div>
<p>Some pagination</p>
<p>PAGE 1</p>
<ul>
{loop type="category" name="catloopwithpagination1" limit="2" page="1"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>PAGE 2</p>
<ul>
{loop type="category" name="catloopwithpagination2" limit="2" page="2"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>PAGE 1000</p>
<ul>
{loop type="category" name="catloopwithpagination1000" limit="2" page="1000"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
{elseloop rel="catloopwithpagination1000"}
NO RESULTS
{/elseloop}
</ul>
</div>
<div>
<p>Some pagination with page choice</p>
{assign var=current_page value=2}
<p>PAGE {$current_page} :</p>
<ul>
{loop type="category" name="catloopwithpaginationchoice" limit="2" page="{$current_page}"}
<li>{$LOOP_COUNT}/{$LOOP_TOTAL} : {$ID} {$TITLE}</li>
{/loop}
</ul>
<p>page choice</p>
{pageloop rel="catloopwithpaginationchoice"}
{if ${PAGE} != {$current_page}}
{if {$PAGE} > {$current_page}-10 AND {$PAGE} < {$current_page}+10}
{$PAGE}
{/if}
{if {$PAGE} == {$current_page}-10 OR {$PAGE} == {$current_page}+10}
...
{/if}
{if ({$PAGE} < {$current_page}-10 OR {$PAGE} > {$current_page}+10) AND ({$PAGE}%10 == 0 OR ${PAGE} == {$LAST} OR ${PAGE} == 1)}
{$PAGE}
{/if}
{else}
{ {$PAGE} }
{/if}
{if {$PAGE} != {$LAST}}
-
{/if}
{/pageloop}
</div>
{include file="includes/footer.html"}