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',
'Delete address' => 'Delete address',
'Delivery address' => 'Delivery address',
'Delivery Informations' => 'Delivery Informations',
'Delivery Information' => '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 Informations',
'Personal Information' => 'Personal Information',
'Placeholder address label' => 'Home, Work office, other',
'Placeholder address1' => '76 Ninth Avenue',
'Placeholder address2' => 'Address',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -96,4 +96,10 @@
display: block;
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;
}
#stockInformations{
#stock-information {
}
}

View File

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

View File

@@ -98,13 +98,16 @@
</td>
<td class="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}">
<select name="quantity" class="form-control" onchange="jQuery(this).parent('form').submit();">
{for $will=1 to $STOCK}
<option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
{/for}
</select>
<div class="form-group">
<select name="quantity" class="form-control" onchange="jQuery(this).parent('form').submit();">
{for $will=1 to $STOCK}
<option {if $QUANTITY == $will}selected="selected"{/if}>{$will}</option>
{/for}
</select>
</div>
<button type="submit" title="{intl l="Update Quantity"}" class="btn btn-cart-update">{intl l="+"}</button>
</form>
</div>
</td>

View File

@@ -162,7 +162,7 @@
</form>
{/form}
{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_hidden_fields form=$form}
@@ -191,7 +191,6 @@
</div>
{form_field form=$form field='invoice-address'}
<div class="panel">
<div class="panel-heading">{intl l="Billing address"}s</div>
@@ -201,65 +200,19 @@
<div class="panel-body">
<table class="col-md-12">
{if !$error && $value}
{assign defaultParam '*'}
{else}
{assign defaultParam 'true'}
{/if}
{if !$error && $value}
{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>
{loop type="address" name="invoice-address"}
{assign var="isInvoiceAddressChecked" value="0"}
{if $isPost}
{if $value == $ID}
{assign var="isInvoiceAddressChecked" value="1"}
{/if}
{elseif $DEFAULT}
{assign var="isInvoiceAddressChecked" value="1"}
{/if}
{/loop}
{if !$error && $value}
{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>
<div class="radio">
<label for="invoice-address_{$ID}">
<input type="radio" name="{$name}" id="invoice-address_{$ID}" value="{$ID}"{if $isInvoiceAddressChecked} checked="checked"{/if}>
<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">
@@ -273,15 +226,11 @@
<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}checked="checked"{/if}>
</td>
</tr>
</label>
</div>
{/loop}
</table>
<a href="#" class="btn btn-change-address hidden">{intl l="Change address"}</a>
</div>
@@ -342,15 +291,21 @@
{block name="javascript-initialization"}
<script type="text/javascript">
jQuery(function($order) {
$order('.js-change-invoice-address').on('click', 'a', function(e) {
e.preventDefault();
jQuery(function($) {
$('#cart-address').each(function(){
var $radio = $('.radio', this),
$btn = $('.btn-change-address');
$order('.js-other-invoice-address').removeClass('hidden');
$order('.js-invoice-address-selector').removeClass('hidden');
// Hide other invoice address
$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();
$order('.js-change-invoice-address').unbind().remove();
return false;
});
});
});
</script>

View File

@@ -113,7 +113,7 @@
<div class="product-price" itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<div class="availability">
<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>
</div>

View File

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