Merge pull request #103 from thelia/frontend

Frontend
This commit is contained in:
Manuel Raynaud
2013-11-12 05:36:09 -08:00
15 changed files with 63 additions and 94 deletions

View File

@@ -44,7 +44,7 @@ return array(
'Date' => 'Date', 'Date' => 'Date',
'Delete address' => 'Delete address', 'Delete address' => 'Delete address',
'Delivery address' => 'Delivery address', 'Delivery address' => 'Delivery address',
'Delivery Informations' => 'Delivery Informations', 'Delivery Information' => 'Delivery Information',
'Demo product description' => 'Demo product description', 'Demo product description' => 'Demo product description',
'Demo product title' => 'Demo product title', 'Demo product title' => 'Demo product title',
'Description' => 'Description', 'Description' => 'Description',
@@ -105,7 +105,7 @@ return array(
'Password Forgotten' => 'Password Forgotten', 'Password Forgotten' => 'Password Forgotten',
'Password' => 'Password', 'Password' => 'Password',
'per page' => 'per page', 'per page' => 'per page',
'Personal Informations' => 'Personal Informations', 'Personal Information' => 'Personal Information',
'Placeholder address label' => 'Home, Work office, other', 'Placeholder address label' => 'Home, Work office, other',
'Placeholder address1' => '76 Ninth Avenue', 'Placeholder address1' => '76 Ninth Avenue',
'Placeholder address2' => 'Address', 'Placeholder address2' => 'Address',

View File

@@ -44,7 +44,7 @@ return array(
'Date' => '', 'Date' => '',
'Delete address' => '', 'Delete address' => '',
'Delivery address' => '', 'Delivery address' => '',
'Delivery Informations' => '', 'Delivery Information' => '',
'Demo product description' => '', 'Demo product description' => '',
'Demo product title' => '', 'Demo product title' => '',
'Description' => '', 'Description' => '',
@@ -105,7 +105,7 @@ return array(
'Password Forgotten' => '', 'Password Forgotten' => '',
'Password' => '', 'Password' => '',
'per page' => '', 'per page' => '',
'Personal Informations' => '', 'Personal Information' => '',
'Placeholder address label' => '', 'Placeholder address label' => '',
'Placeholder address1' => '', 'Placeholder address1' => '',
'Placeholder address2' => '', 'Placeholder address2' => '',

View File

@@ -44,7 +44,7 @@ return array(
'Date' => 'Date', 'Date' => 'Date',
'Delete address' => 'Supprimer cette adresse', 'Delete address' => 'Supprimer cette adresse',
'Delivery address' => 'Adresse de livraison', 'Delivery address' => 'Adresse de livraison',
'Delivery Informations' => 'Informations de livraison', 'Delivery Information' => 'Informations de livraison',
'Demo product description' => 'Example de description de produit', 'Demo product description' => 'Example de description de produit',
'Demo product title' => 'Example de titre', 'Demo product title' => 'Example de titre',
'Description' => 'Description', 'Description' => 'Description',
@@ -108,7 +108,6 @@ return array(
'Password' => 'Mot de passe', 'Password' => 'Mot de passe',
'per page' => 'par page', 'per page' => 'par page',
'Personal Information' => 'Informations personnelles', 'Personal Information' => 'Informations personnelles',
'Personal Informations' => 'Informations personnelles',
'Placeholder address label' => 'Maison, Domicile, Travail...', 'Placeholder address label' => 'Maison, Domicile, Travail...',
'Placeholder address1' => 'Adresse', 'Placeholder address1' => 'Adresse',
'Placeholder address2' => '', 'Placeholder address2' => '',

View File

@@ -44,7 +44,7 @@ return array(
'Date' => '', 'Date' => '',
'Delete address' => '', 'Delete address' => '',
'Delivery address' => '', 'Delivery address' => '',
'Delivery Informations' => '', 'Delivery Information' => '',
'Demo product description' => '', 'Demo product description' => '',
'Demo product title' => '', 'Demo product title' => '',
'Description' => '', 'Description' => '',
@@ -105,7 +105,7 @@ return array(
'Password Forgotten' => '', 'Password Forgotten' => '',
'Password' => '', 'Password' => '',
'per page' => '', 'per page' => '',
'Personal Informations' => '', 'Personal Information' => '',
'Placeholder address label' => '', 'Placeholder address label' => '',
'Placeholder address1' => '', 'Placeholder address1' => '',
'Placeholder address2' => '', 'Placeholder address2' => '',

View File

@@ -35,7 +35,7 @@
<fieldset id="register-info" class="panel"> <fieldset id="register-info" class="panel">
<div class="panel-heading"> <div class="panel-heading">
{intl l="Personal Informations"} {intl l="Personal Information"}
</div> </div>
<div class="panel-body"> <div class="panel-body">

View File

@@ -26,7 +26,7 @@
<div class="panel-heading"> <div class="panel-heading">
<h4 class="panel-title"> <h4 class="panel-title">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#account" href="#account-info"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#account" href="#account-info">
{intl l="Personal Informations"} {intl l="Personal Information"}
</a> </a>
</h4> </h4>
</div> </div>

View File

@@ -229,7 +229,7 @@
var $btnAddToCart = $(".btn_add_to_cart", $("#form-product-details")); var $btnAddToCart = $(".btn_add_to_cart", $("#form-product-details"));
var $productMeta = $("#stockInformations"); var $productMeta = $("#stock-information");
var $inStock = $(".in",$productMeta); var $inStock = $(".in",$productMeta);
var $outOfStock = $(".out",$productMeta); var $outOfStock = $(".out",$productMeta);

View File

@@ -43,6 +43,7 @@
// Keep old style button // Keep old style button
&.btn-add-address, &.btn-add-address,
&.btn-cart-update,
&.btn-coupon, &.btn-coupon,
&.btn-filter, &.btn-filter,
&.btn-grid, &.btn-grid,

View File

@@ -96,4 +96,10 @@
display: block; display: block;
font-size: 2.2em; font-size: 2.2em;
} }
}
// Qty (js enabled)
.js .group-qty {
.form-inline .form-group { display: block; }
.btn-cart-update { .sr-only; }
} }

View File

@@ -31,7 +31,7 @@
text-transform: uppercase; text-transform: uppercase;
} }
#stockInformations{ #stock-information {
} }
} }

View File

@@ -41,3 +41,8 @@
> .pagination { margin: 15px 0 0; } > .pagination { margin: 15px 0 0; }
} }
} }
.no-js .toolbar {
.limiter,
.sort-by { display : none; }
}

View File

@@ -98,13 +98,16 @@
</td> </td>
<td class="qty"> <td class="qty">
<div class="form-group group-qty"> <div class="form-group group-qty">
<form action="{url path="/cart/update"}" method="post"> <form action="{url path="/cart/update"}" class="form-inline" method="post">
<input type="hidden" name="cart_item" value="{$ITEM_ID}"> <input type="hidden" name="cart_item" value="{$ITEM_ID}">
<select name="quantity" class="form-control" onchange="jQuery(this).parent('form').submit();"> <div class="form-group">
{for $will=1 to $STOCK} <select name="quantity" class="form-control" onchange="jQuery(this).parent('form').submit();">
<option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option> {for $will=1 to $STOCK}
{/for} <option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
</select> {/for}
</select>
</div>
<button type="submit" title="{intl l="Update Quantity"}" class="btn btn-cart-update">{intl l="+"}</button>
</form> </form>
</div> </div>
</td> </td>

View File

@@ -162,7 +162,7 @@
</form> </form>
{/form} {/form}
{form name="thelia.order.payment"} {form name="thelia.order.payment"}
{assign var="isPost" value="{$smarty.post|count}"}
<form id="form-cart-payment" action="{url path="/order/invoice"}" method="post" {form_enctype form=$form}> <form id="form-cart-payment" action="{url path="/order/invoice"}" method="post" {form_enctype form=$form}>
{form_hidden_fields form=$form} {form_hidden_fields form=$form}
@@ -191,7 +191,6 @@
</div> </div>
{form_field form=$form field='invoice-address'} {form_field form=$form field='invoice-address'}
<div class="panel"> <div class="panel">
<div class="panel-heading">{intl l="Billing address"}s</div> <div class="panel-heading">{intl l="Billing address"}s</div>
@@ -201,65 +200,19 @@
<div class="panel-body"> <div class="panel-body">
<table class="col-md-12"> {loop type="address" name="invoice-address"}
{assign var="isInvoiceAddressChecked" value="0"}
{if !$error && $value} {if $isPost}
{assign defaultParam '*'} {if $value == $ID}
{else} {assign var="isInvoiceAddressChecked" value="1"}
{assign defaultParam 'true'} {/if}
{/if} {elseif $DEFAULT}
{if !$error && $value} {assign var="isInvoiceAddressChecked" value="1"}
{assign idParam $value}
{else}
{assign idParam '*'}
{/if}
{loop type="address" name="invoice-address" default=$defaultParam id=$idParam}
<tr>
<td>
<span class="fn">{loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$LASTNAME|upper} {$FIRSTNAME|ucwords}</span>
<span class="org">{$COMPANY}</span>
<address class="adr">
<span class="street-address">{$ADDRESS1}</span><br>
{if $ADDRESS2 != ""}
<span class="street-address">{$ADDRESS2}</span><br>
{/if}
{if $ADDRESS3 != ""}
<span class="street-address">{$ADDRESS3}</span><br>
{/if}
<span class="postal-code">{$ZIPCODE}</span>
<span class="locality">{$CITY}, <span class="country-name">{loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}</span></span>
</address>
</td>
<td>
<input class="js-invoice-address-selector {if !$error}hidden{/if}" type="radio" name="{$name}" value="{$ID}" {if $value == $ID OR !$error}checked="checked"{/if}>
</td>
</tr>
{if !$error}
<tr class="js-change-invoice-address">
<td colspan="2">
<a href="#" class="btn btn-change-address">{intl l="Change address"}</a>
</td>
</tr>
{/if} {/if}
{/loop} <div class="radio">
<label for="invoice-address_{$ID}">
{if !$error && $value} <input type="radio" name="{$name}" id="invoice-address_{$ID}" value="{$ID}"{if $isInvoiceAddressChecked} checked="checked"{/if}>
{assign defaultParam '*'}
{else}
{assign defaultParam 'false'}
{/if}
{if !$error && $value}
{assign excludeParam $value}
{else}
{assign excludeParam 'none'}
{/if}
{loop type="address" name="invoice-address" default=$defaultParam exclude=$excludeParam}
<tr class="js-other-invoice-address {if !$error}hidden{/if}">
<td>
<span class="fn">{loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$LASTNAME|upper} {$FIRSTNAME|ucwords}</span> <span class="fn">{loop type="title" name="customer.title.info" id=$TITLE}{$SHORT}{/loop} {$LASTNAME|upper} {$FIRSTNAME|ucwords}</span>
<span class="org">{$COMPANY}</span> <span class="org">{$COMPANY}</span>
<address class="adr"> <address class="adr">
@@ -273,15 +226,11 @@
<span class="postal-code">{$ZIPCODE}</span> <span class="postal-code">{$ZIPCODE}</span>
<span class="locality">{$CITY}, <span class="country-name">{loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}</span></span> <span class="locality">{$CITY}, <span class="country-name">{loop type="country" name="customer.country.info" id=$COUNTRY}{$TITLE}{/loop}</span></span>
</address> </address>
</td> </label>
<td> </div>
<input class="js-invoice-address-selector {if !$error}hidden{/if}" type="radio" name="{$name}" value="{$ID}" {if $value == $ID}checked="checked"{/if}>
</td>
</tr>
{/loop} {/loop}
</table> <a href="#" class="btn btn-change-address hidden">{intl l="Change address"}</a>
</div> </div>
@@ -342,15 +291,21 @@
{block name="javascript-initialization"} {block name="javascript-initialization"}
<script type="text/javascript"> <script type="text/javascript">
jQuery(function($order) { jQuery(function($) {
$order('.js-change-invoice-address').on('click', 'a', function(e) { $('#cart-address').each(function(){
e.preventDefault(); var $radio = $('.radio', this),
$btn = $('.btn-change-address');
$order('.js-other-invoice-address').removeClass('hidden'); // Hide other invoice address
$order('.js-invoice-address-selector').removeClass('hidden'); $radio.filter( function(){ return !$(this).find(':radio').is(':checked'); }).hide();
$btn
.removeClass('hidden')
.bind('click.btn-change-address', function(){
$radio.show();
$(this).hide();
$order('#js-invoice-address-default-selector').unbind().remove(); return false;
$order('.js-change-invoice-address').unbind().remove(); });
}); });
}); });
</script> </script>

View File

@@ -113,7 +113,7 @@
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<div class="availability"> <div class="availability">
<span class="availibity-label">{intl l="Availability"}: </span> <span class="availibity-label">{intl l="Availability"}: </span>
<span itemprop="availability" href="{$current_stock_href}" class="{$current_stock_class}" id="stockInformations"> <span itemprop="availability" href="{$current_stock_href}" class="{$current_stock_class}" id="stock-information">
<span class="in">{intl l='In Stock'}</span><span class="out">{intl l='Out of Stock'}</span> <span class="in">{intl l='In Stock'}</span><span class="out">{intl l='Out of Stock'}</span>
</span> </span>
</div> </div>

View File

@@ -27,7 +27,7 @@
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if} {if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
<fieldset id="register-info" class="panel"> <fieldset id="register-info" class="panel">
<div class="panel-heading"> <div class="panel-heading">
1. {intl l="Personal Informations"} 1. {intl l="Personal Information"}
</div> </div>
<div class="panel-body"> <div class="panel-body">
@@ -116,7 +116,7 @@
<fieldset id="register-delivery" class="panel"> <fieldset id="register-delivery" class="panel">
<div class="panel-heading"> <div class="panel-heading">
2. {intl l="Delivery Informations"} 2. {intl l="Delivery Information"}
</div> </div>
<div class="panel-body"> <div class="panel-body">