Merge branch 'frontend' of https://github.com/thelia/thelia into frontend

This commit is contained in:
touffies
2013-10-18 12:43:27 +02:00
10 changed files with 279 additions and 110 deletions

View File

@@ -4,7 +4,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="home" path="/" >
<route id="home" path="/">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">index</default>
</route>
@@ -16,6 +16,11 @@
<default key="_view">search</default>
</route>
<route id="view_all" path="/view_all" methods="get">
<default key="_controller">Thelia\Controller\Front\DefaultController::noAction</default>
<default key="_view">view_all</default>
</route>
<!-- Customer routes : Register -->
<route id="customer.create.process" path="/register" methods="post">
<default key="_controller">Thelia\Controller\Front\CustomerController::createAction</default>

View File

@@ -86,6 +86,7 @@ class Content extends BaseI18nLoop
*/
public function exec(&$pagination)
{
$search = ContentQuery::create();
/* manage translations */
@@ -138,27 +139,15 @@ class Content extends BaseI18nLoop
$current_folder = $this->getCurrent_folder();
if ($current_folder === true) {
$search->filterByFolder(
FolderQuery::create()->filterByContent(
ContentFolderQuery::create()->filterByContentId(
$this->request->get("content_id"),
Criteria::EQUAL
)->find(),
Criteria::IN
)->find(),
Criteria::IN
);
$current = ContentQuery::create()->findPk($this->request->get("content_id"));
$search->filterByFolder($current->getFolders(), Criteria::IN);
} elseif ($current_folder === false) {
$search->filterByFolder(
FolderQuery::create()->filterByContent(
ContentFolderQuery::create()->filterByContentId(
$this->request->get("content_id"),
Criteria::EQUAL
)->find(),
Criteria::IN
)->find(),
Criteria::NOT_IN
);
$current = ContentQuery::create()->findPk($this->request->get("content_id"));
$search->filterByFolder($current->getFolders(), Criteria::NOT_IN);
}
$visible = $this->getVisible();

View File

@@ -323,7 +323,7 @@ td.product,
.special-price {
.price {
display: block;
font-size: 25px; line-height: 25px;
font-size: 20px; line-height: 25px;
font-style: italic;
}
}

View File

@@ -0,0 +1,36 @@
{extends file="layout.tpl"}
{block name="no-return-functions"}
{check_auth context="front" roles="CUSTOMER" login_tpl="login"}
{/block}
{block name="body-class"}page-content{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{/block}
{block name="main-content"}
<div class="main layout-col-2-left" <!-- class="mainlayout-col-2-left -->">
<article class="col-main" role="main" aria-labelledby="main-label">
{loop name="blog.article" type="content" current="yes"}
<h1>{$TITLE}</h1>
<p class="chapo">
{$CHAPO}
</p>
<p>{$DESCRIPTION nofilter}</p>
{/loop}
</article>
<aside class="col-left" role="complementary" itemscope itemtype="http://schema.org/WPSideBar">
{include file="includes/asides/articles.html"}
</aside>
</div><!-- /.layout -->
{/block}
{block name="after-javascript-include"}{/block}

View File

@@ -0,0 +1,16 @@
<section id="categories" class="block block-nav" role="navigation" aria-labelledby="categories-label">
<div class="block-heading"><h3 class="block-title" >{intl l="Related"}</h3></div>
<div class="block-content">
<nav class="nav-categories">
<ul id="category" class="accordion">
{loop name="current_article" type="content" current="yes"}
{assign var="current_id" value={$ID}}
{/loop}
{loop name="blog.article" type="content" current_folder="yes" exclude="$current_id"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
</ul>
</nav>
</div>
</section>

View File

@@ -1,65 +1,133 @@
<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 -->
{loop name="brand.feature" type="feature" product=$ID title="brand"}
{loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
<meta itemprop="brand" content="{$TITLE}">
{/loop}
{/loop}
{loop name="brand.feature" type="feature" product=$ID title="isbn"}
{loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
<meta itemprop="productID" content="isbn:{$TITLE}">
{/loop}
{/loop}
<a href="{$URL}" itemprop="url" tabindex="-1" class="product-image">
{loop name="product_thumbnail" type="image" product=$ID width="{$width}" height="{$height}" resize_mode="borders" limit="1"}
<img itemprop="image" src="{$IMAGE_URL}" alt="Product #{$LOOP_COUNT}">
{assign var="hasSubmit" value = false}
<article itemscope itemtype="http://schema.org/Product">
<!-- Use the meta tag to specify content that is not visible on the page in any way -->
{loop name="brand.feature" type="feature" product=$ID title="brand"}
{loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
<meta itemprop="brand" content="{$TITLE}">
{/loop}
{/loop}
{loop name="brand.feature" type="feature" product=$ID title="isbn"}
{loop name="brand.value" type="feature_value" feature=$ID product=$product_id}
<meta itemprop="productID" content="isbn:{$TITLE}">
{/loop}
{/loop}
{elseloop rel="product_thumbnail"}
{images file="../assets/img/{$width}x{$height}.png"}<img itemprop="image" src="{$asset_url}" alt="Product #{$LOOP_COUNT}">{/images}
{/elseloop}
<span class="mask"></span>
</a>
<div class="product-info">
<h3 class="name"><a href="{$URL}"><span itemprop="name">{$TITLE}</span></a></h3>
{if $hasDescription}
<div class="description" itemprop="description">
<p>{$DESCRIPTION}</p>
</div>
{/if}
</div>
<a href="{$URL}" itemprop="url" tabindex="-1" class="product-image">
{loop name="product_thumbnail" type="image" product=$ID width="{$width}" height="{$height}" resize_mode="borders" limit="1"}
<img itemprop="image" src="{$IMAGE_URL}" alt="Product #{$LOOP_COUNT}">
{/loop}
{elseloop rel="product_thumbnail"}
{images file="../assets/img/{$width}x{$height}.png"}<img itemprop="image" src="{$asset_url}" alt="Product #{$LOOP_COUNT}">{/images}
{/elseloop}
<span class="mask"></span>
</a>
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="category" content="{category attr="title"}">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
<meta itemprop="priceCurrency" content="{currency attr="symbol"}"> <!-- 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
instore_only : http://schema.org/InStoreOnly
preorder : http://schema.org/PreOrder
online_only : http://schema.org/OnlineOnly
-->
{if $IS_PROMO }
{loop name="productSaleElements_promo" type="product_sale_elements" product=$ID limit="1" order="min_price"}
{assign var="default_product_sale_elements" value=$ID}
<span class="special-price"><span itemprop="price" class="price-label">{intl l="Special Price:"} </span><span class="price">{format_number number=$TAXED_PROMO_PRICE} {currency attr="symbol"}</span></span>
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span class="price">{format_number number=$TAXED_PRICE} {currency attr="symbol"}</span></span>
{/loop}
{else}
<span class="regular-price"><span itemprop="price" class="price">{format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"}</span></span>
<div class="product-info">
<h3 class="name"><a href="{$URL}"><span itemprop="name">{$TITLE}</span></a></h3>
{if $hasDescription}
<div class="description" itemprop="description">
<p>{$DESCRIPTION}</p>
</div>
{/if}
</div>
<div class="product-price">
<div class="price-container" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<meta itemprop="category" content="{category attr="title"}">
<meta itemprop="itemCondition" itemscope itemtype="http://schema.org/NewCondition"> <!-- List of condition : NewCondition, DamagedCondition, UsedCondition, RefurbishedCondition -->
<meta itemprop="priceCurrency" content="{currency attr="symbol"}"> <!-- 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
instore_only : http://schema.org/InStoreOnly
preorder : http://schema.org/PreOrder
online_only : http://schema.org/OnlineOnly
-->
{if $IS_PROMO }
{loop name="productSaleElements_promo" type="product_sale_elements" product=$ID limit="1" order="min_price"}
{assign var="default_product_sale_elements" value=$ID}
<span class="special-price"><span itemprop="price" class="price-label">{intl l="Special Price:"} </span><span class="price">{format_number number=$TAXED_PROMO_PRICE} {currency attr="symbol"}</span></span>
<span class="old-price"><span class="price-label">{intl l="Regular Price:"} </span><span class="price">{format_number number=$TAXED_PRICE} {currency attr="symbol"}</span></span>
{/loop}
{else}
<span class="regular-price"><span itemprop="price" class="price">{format_number number=$BEST_TAXED_PRICE} {currency attr="symbol"}</span></span>
{/if}
</div>
{form name="thelia.cart.add" }
<form id="form-product-details" action="{url path="/cart/add" }" method="post" role="form">
{form_hidden_fields form=$form}
<input type="hidden" name="view" value="product">
<input type="hidden" name="product_id" value="{$ID}">
{if $form_error}<div class="alert alert-error">{$form_error_message}</div>{/if}
{form_field form=$form field='product_sale_elements_id'}
{if $default_product_sale_elements }
<input type="hidden" name="{$name}" value="{$default_product_sale_elements}" {$attr}>
{else}
{loop name="productSaleElements_promo" type="product_sale_elements" product="{$ID}" limit="1"}
<input type="hidden" name="{$name}" value="{$ID}" {$attr}>
{/loop}
{/if}
{/form_field}
{form_field form=$form field="product"}
<input id="{$label_attr.for}" type="hidden" name="{$name}" value="{$ID}" {$attr} >
{/form_field}
<fieldset class="product-options hide">
{ifloop rel="stock"}
<div class="option">
<label for="options" class="option-heading">Options</label>
<div class="option-content">
<select name="options" class="form-control">
{loop name="stock" type="product_sale_elements" product="$ID" order="min_price"}
{if $LOOP_TOTAL == 1}
{assign var="hasSubmit" value = true}
{/if}
{loop name="combi" type="attribute_combination" product_sale_elements="$ID" order="alpha"}
<option value="{$ID}" data-quantity="{$QUANTITY}" data-price="{format_number number="{$BEST_TAXED_PRICE}"} {currency attr="symbol"}" data-old-price="{format_number number="{$TAXED_PRICE}"} {currency attr="symbol"}">{$ATTRIBUTE_AVAILABILITY_TITLE}</small></option>
{/loop}
{/loop}
</select>
</div>
</div>
{/ifloop}
</fieldset>
<fieldset class="product-cart form-inline">
{form_field form=$form field='quantity'}
<div class="form-group group-qty hide {if $error}has-error{elseif $value != "" && !$error}has-success{/if}">
<label for="{$label_attr.for}">{$label}</label>
<input type="number" name="{$name}" id="{$label_attr.for}" class="form-control" value="{$value|default:1}" min="0" 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>
{/form_field}
<div class="form-group group-btn">
</div>
<div>
<div class="product-btn">
{if $hasSubmit == true}
<button type="submit" class="btn btn-cart">{intl l="Add to cart"}</button>
{else}
<a href="{$URL}" class="btn btn-cart">{intl l="View product"}</a>
{/if}
</div>
</div>
</fieldset>
</form>
{/form}
</div>
{if $hasBtn}
<div class="product-btn">
<button class="btn btn-cart">Add to cart</button>
</div>
{/if}
</div>
</article><!-- /product -->
</article><!-- /product -->
</li>

View File

@@ -30,7 +30,7 @@
<section id="products-new">
<div class="products-heading">
<h2>{intl l="Latest"} <a href="#latest" class="btn-all">{intl l="+ View All"}</a></h2>
<h2>{intl l="Latest"} <a href="{url path="/view_all" type="new"}" class="btn-all">{intl l="+ View All"}</a></h2>
</div>
<div class="products-content">
@@ -99,7 +99,7 @@
<section id="products-offer">
<div class="products-heading">
<h2>{intl l="Offers"} <a href="#offer" class="btn-all">{intl l="+ View All"}</a></h2>
<h2>{intl l="Offers"} <a href="{url path="/view_all" type="offers"}" class="btn-all">{intl l="+ View All"}</a></h2>
</div>
<div class="products-content">

View File

@@ -201,26 +201,23 @@ URL: http://www.thelia.net
<section class="block block-links">
<div class="block-heading"><h3 class="block-title">Latest articles</h3></div>
<div class="block-content">
<ul>
<li>
<a href="#">
<h4 class="block-subtitle">Heading</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</a>
</li>
<li>
<a href="#">
<h4 class="block-subtitle">Heading</h4>
<p>Lorem ipsum dolor sit amet...</p>
</a>
</li>
<li>
<a href="#">
<h4 class="block-subtitle">Heading</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
</a>
</li>
</ul>
{ifloop rel="blog.articles"}
<ul>
{loop type="content" name="blog.articles" folder="1" limit="3"}
<li>
<a href="{$URL}">
<h4 class="block-subtitle">{$TITLE}</h4>
<p>{$CHAPO}</p>
</a>
</li>
{/loop}
</ul>
{/ifloop}
{elseloop rel="blog.articles"}
<ul>
<li>{intl l="No articles currently"}</li>
</ul>
{/elseloop}
</div>
</section>
</div>
@@ -229,13 +226,12 @@ URL: http://www.thelia.net
<div class="block-heading"><h3 class="block-title">Usefull links</h3></div>
<div class="block-content">
<ul>
<li class="active"><a href="#" tabindex="-1">About Us </a></li>
<li><a href="#">Delivery & Returns</a></li>
<li><a href="#">Terms & Conditions </a></li>
<li><a href="contact.html">Contact Us</a></li>
{loop name="footer_links" type="content" folder="2"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
<li><a href="{url path="/login"}">Login</a></li>
<li><a href="{url path="/register"}">Register</a></li>
<li><a href="checkout.html">Checkout</a></li>
<li><a href="{url path="/order/delivery"}">Checkout</a></li>
</ul>
</div>
</section>
@@ -346,8 +342,9 @@ URL: http://www.thelia.net
<div class="info">
<nav class="nav-footer" role="navigation">
<ul>
<li class="active"><a href="#" tabindex="-1">About Us </a></li>
<li><a href="#">Delivery & Returns</a></li>
{loop name="footer_links" type="content" folder="2"}
<li><a href="{$URL}">{$TITLE}</a></li>
{/loop}
<li><a href="#">Site Map</a></li>
<li><a href="#">Terms & Conditions</a></li>
<li><a href="#">Contact Us</a></li>

View File

@@ -160,8 +160,8 @@
<label for="options" class="option-heading">Options</label>
<div class="option-content">
<select name="options" class="form-control">
{loop name="stock" type="product_sale_elements" product="$ID"}
{loop name="combi" type="attribute_combination" product_sale_elements="$ID"}
{loop name="stock" type="product_sale_elements" product="$ID" order="min_price"}
{loop name="combi" type="attribute_combination" product_sale_elements="$ID" order="alpha"}
<option value="{$ID}" data-quantity="{$QUANTITY}" data-price="{format_number number="{$BEST_TAXED_PRICE}"} {currency attr="symbol"}" data-old-price="{format_number number="{$TAXED_PRICE}"} {currency attr="symbol"}">{$ATTRIBUTE_AVAILABILITY_TITLE}</small></option>
{/loop}
{/loop}

View File

@@ -0,0 +1,58 @@
{extends file="layout.tpl"}
{block name="body-class"}page-view-all{/block}
{* Breadcrumb *}
{block name='no-return-functions' append}
{$breadcrumbs = [
['title' => {intl l="View all"}, 'url'=>{url path="/view_all"}]
]}
{/block}
{block name="main-content"}
<div class="main">
{$limit={$smarty.get.limit|default:8}}
{$product_page={$smarty.get.page|default:1}}
{$product_order={$smarty.get.order|default:'alpha'}}
<article class="col-main {$smarty.get.mode|default:"grid"}" role="main" aria-labelledby="main-label">
{if $smarty.get.type == "new"}
<h1 id="main-label" class="page-header">{intl l="View all"} {$smarty.get.type} {intl l="products"}</h1>
{else}
<h1 id="main-label" class="page-header">{intl l="View all"} {intl l="offers"}</h1>
{/if}
{include file="includes/toolbar.html" toolbar="top" limit=$limit order=$product_order}
<div id="category-products">
<div class="products-content">
{ifloop rel="product_list"}
<ul class="product-col-3">
{if $smarty.get.type == "new"}
{loop type="product" name="product_list" limit=$limit page=$product_page order=$product_order}
{include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="700" height="320"}
{/loop}
{else}
{loop type="product" name="product_list" promo="yes" limit=$limit page=$product_page order=$product_order}
{include file="includes/single-product.html" product_id=$ID hasBtn=true hasDescription=true width="700" height="320"}
{/loop}
{/if}
</ul>
{/ifloop}
{elseloop rel="product_list"}
<h2 class="text-center">{intl l="No results found"} </h2>
{/elseloop}
</div>
</div><!-- /#category-products -->
{ifloop rel="product_list"}
{include file="includes/toolbar.html" toolbar="bottom"}
{/ifloop}
</article>
</div><!-- /.layout -->
{/block}
{block name="after-javascript-include"}{/block}