Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
Jerome Nadaud
2013-10-25 15:55:39 +02:00
18 changed files with 365 additions and 81 deletions
File diff suppressed because one or more lines are too long
@@ -116,12 +116,10 @@ input[type="text"],input[type="search"],input[type="password"], textarea, select
.panel-footer
margin: 15px -20px -20px
height: 73px
.panel-footer
.btn.pull-right
margin-left: 3px
//todo: fix focus firefox
*:focus
outline: none!important
-moz-outline: none!important
-moz-user-focus: ignore!important
//components
@import "admin-theme/admin-header"
@@ -142,3 +140,4 @@ input[type="text"],input[type="search"],input[type="password"], textarea, select
@import "admin-theme/admin-carrier-wizard"
@import "admin-theme/admin-modules"
@import "admin-theme/admin-dashboard"
@import "admin-theme/admin-search"
@@ -0,0 +1,8 @@
.adminsearch
#content
.panel .panel
padding: 0
margin: 0
border: none
@include border-radius(0)
@include box-shadow(0)
@@ -79,7 +79,7 @@
</div>
<div class="form-group">
<a href="#" class="show-forgot-password pull-right" >
{l s='Lost password'}&hellip;
{l s='Lost password'}
</a>
<label class="control-label" for="passwd">
{l s='Password'}
@@ -138,16 +138,16 @@
id="email_forgot"
class="form-control"
autofocus="autofocus"
tabindex="1"
tabindex="5"
placeholder="test@example.com" />
</div>
</div>
<div class="panel-footer">
<button href="#" class="btn btn-default show-login-form" tabindex="3">
<button href="#" class="btn btn-default show-login-form" tabindex="7">
<i class="icon-caret-left"></i>
{l s='Back to login'}
</button>
<button class="btn btn-default pull-right" name="submitLogin" type="submit" tabindex="2">
<button class="btn btn-default pull-right" name="submitLogin" type="submit" tabindex="6">
<i class="icon-ok text-success"></i>
{l s='Send'}
</button>
@@ -29,19 +29,32 @@ $(function() {
});
</script>
{if isset($features)}
<div class="panel">
{if !$features}
<h3>{l s='No features matching your query'} : {$query}</h3>
{if !$nb_results}
<h2>{l s='There are no results matching your query "%s".' sprintf=$query}</h2>
{else}
<h2>
{if $nb_results == 1}
{l s='1 result matches your query "%s".' sprintf=$query}
{else}
<h3>{l s='Features matching your query'} : {$query}</h3>
{l s='%d results match your query "%s".' sprintf=[$nb_results|intval, $query]}
{/if}
</h2>
{if isset($features)}
<div class="panel">
<h3>
{if $features|@count == 1}
{l s='1 feature'}
{else}
{l s='%d features' sprintf=$features|@count}
{/if}
</h3>
<table class="table">
<tbody>
{foreach $features key=key item=feature}
{foreach $feature key=k item=val name=feature_list}
<tr>
<td><strong>{if $smarty.foreach.feature_list.first}{$key}{/if}</strong></td>
<td>
<a href="{$val.link}">{$val.value}</a>
</td>
@@ -50,16 +63,18 @@ $(function() {
{/foreach}
</tbody>
</table>
{/if}
</div>
{/if}
{/if}
{if isset($modules)}
{if isset($modules) && $modules}
<div class="panel">
{if !$modules}
<h3>{l s='No modules matching your query'} : {$query}</h3>
{else}
<h3>{l s='Modules matching your query'} : {$query}</h3>
<h3>
{if $modules|@count == 1}
{l s='1 module'}
{else}
{l s='%d modules' sprintf=$modules|@count}
{/if}
</h3>
<table class="table">
<tbody>
{foreach $modules key=key item=module}
@@ -70,16 +85,18 @@ $(function() {
{/foreach}
</tbody>
</table>
{/if}
</div>
{/if}
{/if}
{if isset($categories)}
{if isset($categories) && $categories}
<div class="panel">
{if !$categories}
<h3>{l s='No categories matching your query'} : {$query}</h3>
{else}
<h3>{l s='Categories matching your query'} : {$query}</h3>
<h3>
{if $categories|@count == 1}
{l s='1 category'}
{else}
{l s='%d categories' sprintf=$categories|@count}
{/if}
</h3>
<table cellspacing="0" cellpadding="0" class="table">
{foreach $categories key=key item=category}
<tr class="alt_row">
@@ -87,39 +104,45 @@ $(function() {
</tr>
{/foreach}
</table>
{/if}
</div>
{/if}
{/if}
{if isset($products)}
{if isset($products) && $products}
<div class="panel">
{if !$products}
<h3>{l s='There are no products matching your query'} : {$query}</h3>
{else}
<h3>{l s='Products matching your query'} : {$query}</h3>
<h3>
{if $products|@count == 1}
{l s='1 product'}
{else}
{l s='%d products' sprintf=$products|@count}
{/if}
</h3>
{$products}
{/if}
</div>
{/if}
{/if}
{if isset($customers)}
{if isset($customers) && $customers}
<div class="panel">
{if !$customers}
<h3>{l s='There are no customers matching your query'} : {$query}</h3>
{else}
<h3>{l s='Customers matching your query'} : {$query}</h3>
<h3>
{if $customers|@count == 1}
{l s='1 customer'}
{else}
{l s='%d customers' sprintf=$customers|@count}
{/if}
</h3>
{$customers}
{/if}
</div>
{/if}
{/if}
{if isset($orders)}
{if isset($orders) && $orders}
<div class="panel">
{if !$orders}
<h3>{l s='There are no orders matching your query'} : {$query}</h3>
{else}
<h3>{l s='Orders matching your query'} : {$query}</h3>
<h3>
{if $orders|@count == 1}
{l s='1 order'}
{else}
{l s='%d orders' sprintf=$orders|@count}
{/if}
</h3>
{$orders}
{/if}
</div>
{/if}
{/if}
{/if}
+1 -1
View File
@@ -105,7 +105,7 @@
</head>
{if $display_header}
<body class="{if $employee->bo_menu}page-sidebar {* page-sidebar-closed *}{else}page-topbar{/if}">
<body class="{if $employee->bo_menu}page-sidebar {* page-sidebar-closed *}{else}page-topbar{/if} {$smarty.get.controller|escape|strtolower}">
{* begin HEADER *}
<header id="header">
+4
View File
@@ -378,6 +378,8 @@
'HelperTreeCategoriesCore' => 'classes/helper/HelperTreeCategories.php',
'HelperTreeShops' => '',
'HelperTreeShopsCore' => 'classes/helper/HelperTreeShops.php',
'HelperUploader' => '',
'HelperUploaderCore' => 'classes/helper/HelperUploader.php',
'HelperView' => '',
'HelperViewCore' => 'classes/helper/HelperView.php',
'HistoryController' => '',
@@ -644,6 +646,8 @@
'TreeToolbarSearchCore' => 'classes/tree/TreeToolbarSearch.php',
'Upgrader' => '',
'UpgraderCore' => 'classes/Upgrader.php',
'Uploader' => '',
'UploaderCore' => 'classes/Uploader.php',
'Validate' => '',
'ValidateCore' => 'classes/Validate.php',
'Warehouse' => '',
+18 -8
View File
@@ -217,8 +217,10 @@ class AdminSearchControllerCore extends AdminController
$result = Db::getInstance()->executeS('
SELECT class_name, name
FROM '._DB_PREFIX_.'tab t
INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->language->id.')
WHERE active = 1');
INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->employee->id_lang.')
LEFT JOIN '._DB_PREFIX_.'access a ON (a.id_tab = t.id_tab AND a.id_profile = '.(int)$this->context->employee->id_profile.')
WHERE active = 1
'.($this->context->employee->id_profile != 1 ? 'AND view = 1' : ''));
foreach ($result as $row)
{
$tabs[strtolower($row['class_name'])] = $row['name'];
@@ -227,6 +229,8 @@ class AdminSearchControllerCore extends AdminController
foreach (AdminTab::$tabParenting as $key => $value)
{
$value = stripslashes($value);
if (!isset($tabs[strtolower($key)]) || !isset($tabs[strtolower($value)]))
continue;
$tabs[strtolower($key)] = $tabs[strtolower($value)];
$key_match[strtolower($key)] = $key;
}
@@ -324,16 +328,22 @@ class AdminSearchControllerCore extends AdminController
return parent::renderView();
else
{
if (isset($this->_list['features']))
$nb_results = 0;
foreach ($this->_list as $list)
if ($list != false)
$nb_results += count($list);
$this->tpl_view_vars['nb_results'] = $nb_results;
if (isset($this->_list['features']) && count($this->_list['features']))
$this->tpl_view_vars['features'] = $this->_list['features'];
if (isset($this->_list['categories']))
if (isset($this->_list['categories']) && count($this->_list['categories']))
{
$categories = array();
foreach ($this->_list['categories'] as $category)
$categories[] = getPath($this->context->link->getAdminLink('AdminCategories', false), $category['id_category']);
$this->tpl_view_vars['categories'] = $categories;
}
if (isset($this->_list['products']))
if (isset($this->_list['products']) && count($this->_list['products']))
{
$view = '';
$this->initProductList();
@@ -353,7 +363,7 @@ class AdminSearchControllerCore extends AdminController
$this->tpl_view_vars['products'] = $view;
}
if (isset($this->_list['customers']))
if (isset($this->_list['customers']) && count($this->_list['customers']))
{
$view = '';
$this->initCustomerList();
@@ -376,7 +386,7 @@ class AdminSearchControllerCore extends AdminController
}
$this->tpl_view_vars['customers'] = $view;
}
if (isset($this->_list['orders']))
if (isset($this->_list['orders']) && count($this->_list['orders']))
{
$view = '';
$this->initOrderList();
@@ -396,7 +406,7 @@ class AdminSearchControllerCore extends AdminController
$this->tpl_view_vars['orders'] = $view;
}
if (isset($this->_list['modules']))
if (isset($this->_list['modules']) && count($this->_list['modules']))
$this->tpl_view_vars['modules'] = $this->_list['modules'];
return parent::renderView();
+1
View File
@@ -708,6 +708,7 @@ function checkMultishopDefaultValue(obj, key)
{
$('#conf_id_'+key+' input, #conf_id_'+key+' textarea, #conf_id_'+key+' select').attr('disabled', true);
$('#conf_id_'+key+' label.conf_title').addClass('isDisabled');
$(obj).attr('disabled', false);
}
else
{
+11 -15
View File
@@ -59,18 +59,18 @@ $(document).ready(function() {
}
});
$('.show-forgot-password').click(function(e) {
// Kill default behaviour
$('.show-forgot-password').on('click',function(e) {
e.preventDefault();
displayForgotPassword();
});
$('.show-login-form').click(function(e) {
// Kill default behaviour
$('.show-login-form').on('click',function(e) {
e.preventDefault();
displayLogin();
});
$('#email').focus();
//Tab-index loop
$('form').each(function(){
var list = $(this).find('*[tabindex]').sort(function(a,b){ return a.tabIndex < b.tabIndex ? -1 : 1; }),
@@ -84,7 +84,7 @@ $(document).ready(function() {
});
});
//todo: ladda init - move to top
//todo: ladda init
var l = new Object();
function feedbackSubmit() {
l = Ladda.create( document.querySelector( 'button[type=submit]' ) );
@@ -127,16 +127,17 @@ function doAjaxLogin(redirect) {
redirect: redirect,
stay_logged_in: $('#stay_logged_in:checked').val()
},
beforeSend: function(){
beforeSend: function() {
feedbackSubmit();
l.start();
},
success: function(jsonData) {
if (jsonData.hasErrors)
if (jsonData.hasErrors) {
displayErrors(jsonData.errors);
l.stop();
else
} else {
window.location.assign(jsonData.redirect);
}
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
l.stop();
@@ -164,9 +165,9 @@ function doAjaxForgot() {
email_forgot: $('#email_forgot').val()
},
success: function(jsonData) {
if (jsonData.hasErrors)
if (jsonData.hasErrors) {
displayErrors(jsonData.errors);
else {
} else {
alert(jsonData.confirm);
$('#forgot_password_form').hide();
displayLogin();
@@ -185,9 +186,4 @@ function displayErrors(errors) {
for (var error in errors) //IE6 bug fix
if (error != 'indexOf') str_errors += '<li>' + errors[error] + '</li>';
$('#error').html(str_errors + '</ol>').removeClass('hide').fadeIn('slow');
// $("#login").effect("shake", {
// times: 4
// }, 100);
}
@@ -0,0 +1,15 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -0,0 +1,54 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -0,0 +1,28 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Congratulations!'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<?php echo t('Your referred friend,'); ?> <span><strong>{sponsored_firstname} {sponsored_lastname}</strong></span> <?php echo t('has placed his or her first order on <a href="{shop_url}">{shop_name}</a>!'); ?><br /><br />
<?php echo t('We are pleased to offer you a voucher worth'); ?> <span><strong>{discount_display} (voucher # {discount_name})</strong></span> <?php echo t('that you can use on your next order.'); ?>
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<span><?php echo t('Best regards,'); ?></span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -0,0 +1,31 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title">{firstname_friend} {lastname_friend}, <?php echo t('join us!'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<span>
<?php echo t('Your friend,'); ?> <span><strong>{firstname} {lastname}</strong></span> <?php echo t('wants to refer you on <a href="{shop_url}">{shop_name}</a>!'); ?><br /><br />
<?php echo t('We are pleased to offer you a voucher worth'); ?> <span><strong>{discount_display} (voucher # {discount_name})</strong></span> <?php echo t('that you can use on your next order.'); ?><br /><br />
<?php echo t('Get referred and earn a discount voucher of'); ?> <span><strong>{discount}!</strong></span>
<a title="Register" href="{link}"><?php echo t('It&#039;s very easy to sign up. Just click here!'); ?></a>
</span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>
<span><?php echo t('When signing up, don&#039;t forget to provide the e-mail address of your referring friend:'); ?> <span><strong>{email}</strong></span>.<br/><br/>
<span><?php echo t('Best regards,'); ?>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -0,0 +1,24 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {firstname} {lastname},'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
<?php echo t('Referral Program'); ?>
</p>
<span>
<?php echo t('We have created a voucher in your name for referring a friend.'); ?><br />
<?php echo t('Here is the code of your voucher:'); ?> <span><strong>{voucher_num}</strong></span><?php echo t(', with an amount of'); ?> <span><strong>{voucher_amount}</strong></span>.<br /><br />
<?php echo t('Simply copy/paste this code during the payment process for your next order.'); ?>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>
@@ -0,0 +1,15 @@
<tr>
<td class="space_footer">&nbsp;</td>
</tr>
<tr>
<td class="footer">
<span><?php echo t('<a href="{shop_url}">{shop_name}</a> powered by <a href="http://www.prestashop.com/">PrestaShop&trade;</a>'); ?></span>
</td>
</tr>
</table>
</td>
<td class="space">&nbsp;</td>
</tr>
</table>
</body>
</html>
@@ -0,0 +1,54 @@
<?php
if(!function_exists('t'))
{
function t($str)
{
return $str;
}
}
if(!function_exists('findRelativePathToAdminDir'))
{
function findRelativePathToAdminDir($maxDepth=6)
{
$path = '';
for($i=0; $i<$maxDepth; $i++)
{
foreach(scandir(dirname(__FILE__).'/'.$path) as $dir)
{
$candidate = $path.$dir.'/';
if(is_dir(dirname(__FILE__).'/'.$candidate.'tabs'))
{
return $candidate;
}
}
$path .= '../';
}
return false;
}
}
$admin = findRelativePathToAdminDir();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><?php echo t('Message from {shop_name}'); ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $admin ?>themes/default/css/admin-theme/email.css">
</head>
<body>
<table class="table table-mail">
<tr>
<td class="space">&nbsp;</td>
<td align="center">
<table class="table">
<tr>
<td align="center" class="logo">
<a title="{shop_name}" href="{shop_url}">
<img src="{shop_logo}" alt="{shop_name}" />
</a>
</td>
</tr>
@@ -0,0 +1,23 @@
<?php include ('header.php'); ?>
<tr>
<td align="center">
<span class="title"><?php echo t('Hi {name},'); ?></span><br/>
<span class="subtitle"><?php echo t('Thank you for creating a customer account at {shop_name}.'); ?></span>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td class="box">
<p>
{customer} <?php echo t('has sent you a link to a product that (s)he thinks may interest you.'); ?>
</p>
<span>
<?php echo t('Click here to view this item:'); ?> <a href="{product_link}">{product}</a>
</span>
</td>
</tr>
<?php include ('footer.php'); ?>