[*] BO : Init Bootstrap (Sass) BO

This commit is contained in:
Kevin Granger
2013-06-13 18:03:34 +02:00
parent be0d6f1c6c
commit 86ef69c9ba
93 changed files with 16827 additions and 853 deletions
+133 -125
View File
@@ -23,13 +23,38 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="toolbar-placeholder">
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if}">
{block name=toolbarBox}
<ul class="cc_button">
<div class="toolbarBox {if $toolbar_scroll}toolbarHead{/if} ">
{block name=pageTitle}
<ul class="breadcrumb">
<li>
{if $title}
{foreach $title as $key => $item name=title}
{* Use strip_tags because if the string already has been through htmlentities using escape will break it *}
<span class="item-{$key} ">{$item|strip_tags}
{if !$smarty.foreach.title.last}
<img alt="&gt;" style="margin-right:5px" src="../img/admin/separator_breadcrumb.png" />
{/if}
</span>
{/foreach}
{else}
&nbsp;
{/if}
</li>
</ul>
<div class="page-header">
<h1>{$title|end}</h1>
</div>
{/block}
{block name=toolbarBox}
<div class="well">
<ul class="cc_button nav nav-pills">
{foreach from=$toolbar_btn item=btn key=k}
<li>
<a id="desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" class="toolbar_btn" {if isset($btn.href)}href="{$btn.href}"{/if} title="{$btn.desc}" {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
<a id="desc-{$table}-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if}" class="btn" {if isset($btn.href)}href="{$btn.href}"{/if} title="{$btn.desc}" {if isset($btn.target) && $btn.target}target="_blank"{/if}{if isset($btn.js) && $btn.js}onclick="{$btn.js}"{/if}>
<span class="process-icon-{if isset($btn.imgclass)}{$btn.imgclass}{else}{$k}{/if} {if isset($btn.class)}{$btn.class}{/if}" ></span>
<div {if isset($btn.force_desc) && $btn.force_desc == true } class="locked" {/if}>{$btn.desc}</div>
</a>
@@ -45,141 +70,124 @@
</li>
{/foreach}
</ul>
</div>
<script language="javascript" type="text/javascript">
//<![CDATA[
var submited = false
var modules_list_loaded = false;
$(function() {
//get reference on save link
btn_save = $('span[class~="process-icon-save"]').parent();
<script language="javascript" type="text/javascript">
//<![CDATA[
var submited = false
var modules_list_loaded = false;
$(function() {
//get reference on save link
btn_save = $('span[class~="process-icon-save"]').parent();
//get reference on form submit button
btn_submit = $('#{$table}_form_submit_btn');
//get reference on form submit button
btn_submit = $('#{$table}_form_submit_btn');
if (btn_save.length > 0 && btn_submit.length > 0)
if (btn_save.length > 0 && btn_submit.length > 0)
{
//get reference on save and stay link
btn_save_and_stay = $('span[class~="process-icon-save-and-stay"]').parent();
//get reference on current save link label
lbl_save = $('#desc-{$table}-save div');
//override save link label with submit button value
if (btn_submit.val().length > 0)
lbl_save.html(btn_submit.attr("value"));
if (btn_save_and_stay.length > 0)
{
//get reference on save and stay link
btn_save_and_stay = $('span[class~="process-icon-save-and-stay"]').parent();
//get reference on current save link label
lbl_save = $('#desc-{$table}-save div');
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
//override save link label with submit button value
if (btn_submit.val().length > 0)
lbl_save.html(btn_submit.attr("value"));
if (btn_save_and_stay.length > 0)
//override save and stay link label with submit button value
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
{
//get reference on current save link label
lbl_save_and_stay = $('#desc-{$table}-save-and-stay div');
//override save and stay link label with submit button value
if (btn_submit.val().length > 0 && lbl_save_and_stay && !lbl_save_and_stay.hasClass('locked'))
{
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
}
lbl_save_and_stay.html(btn_submit.val() + " {l s='and stay'} ");
}
//hide standard submit button
btn_submit.hide();
//bind enter key press to validate form
$('#{$table}_form').keypress(function (e) {
if (e.which == 13 && e.target.localName != 'textarea')
$('#desc-{$table}-save').click();
}
//hide standard submit button
btn_submit.hide();
//bind enter key press to validate form
$('#{$table}_form').keypress(function (e) {
if (e.which == 13 && e.target.localName != 'textarea')
$('#desc-{$table}-save').click();
});
//submit the form
{block name=formSubmit}
btn_save.click(function() {
// Avoid double click
if (submited)
return false;
submited = true;
//add hidden input to emulate submit button click when posting the form -> field name posted
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
$('#{$table}_form').submit();
return false;
});
//submit the form
{block name=formSubmit}
btn_save.click(function() {
// Avoid double click
if (submited)
return false;
submited = true;
if (btn_save_and_stay)
{
btn_save_and_stay.click(function() {
//add hidden input to emulate submit button click when posting the form -> field name posted
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'" value="1" />');
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
$('#{$table}_form').submit();
return false;
});
if (btn_save_and_stay)
{
btn_save_and_stay.click(function() {
//add hidden input to emulate submit button click when posting the form -> field name posted
btn_submit.before('<input type="hidden" name="'+btn_submit.attr("name")+'AndStay" value="1" />');
$('#{$table}_form').submit();
return false;
});
}
{/block}
}
{if isset($tab_modules_open)}
if ({$tab_modules_open})
openModulesList();
{/if}
});
{if isset($tab_modules_list)}
$('.process-icon-modules-list').parent('a').unbind().bind('click', function (){
openModulesList();
});
function openModulesList()
{
$('#modules_list_container').slideDown();
if (!modules_list_loaded)
{
$.ajax({
type: "POST",
url : '{$admin_module_ajax_url}',
async: true,
data : {
ajax : "1",
controller : "AdminModules",
action : "getTabModulesList",
tab_modules_list : '{$tab_modules_list}',
back_tab_modules_list : '{$back_tab_modules_list}'
},
success : function(data)
{
$('#modules_list_container_tab').html(data).slideDown();
$('#modules_list_loader').hide();
modules_list_loaded = true;
}
});
}
else
{
$('#modules_list_container_tab').slideDown();
$('#modules_list_loader').hide();
}
return false;
}
{/block}
}
{if isset($tab_modules_open)}
if ({$tab_modules_open})
openModulesList();
{/if}
//]]>
</script>
{/block}
<div class="pageTitle">
<h3>{block name=pageTitle}
<span id="current_obj" style="font-weight: normal;">
{if $title}
{foreach $title as $key => $item name=title}
{* Use strip_tags because if the string already has been through htmlentities using escape will break it *}
<span class="breadcrumb item-{$key} ">{$item|strip_tags}
{if !$smarty.foreach.title.last}
<img alt="&gt;" style="margin-right:5px" src="../img/admin/separator_breadcrumb.png" />
{/if}
</span>
{/foreach}
{else}
&nbsp;
{/if}
</span>
{/block}
</h3>
</div>
</div>
</div>
});
{if isset($tab_modules_list)}
$('.process-icon-modules-list').parent('a').unbind().bind('click', function (){
openModulesList();
});
function openModulesList()
{
$('#modules_list_container').slideDown();
if (!modules_list_loaded)
{
$.ajax({
type: "POST",
url : '{$admin_module_ajax_url}',
async: true,
data : {
ajax : "1",
controller : "AdminModules",
action : "getTabModulesList",
tab_modules_list : '{$tab_modules_list}',
back_tab_modules_list : '{$back_tab_modules_list}'
},
success : function(data)
{
$('#modules_list_container_tab').html(data).slideDown();
$('#modules_list_loader').hide();
modules_list_loaded = true;
}
});
}
else
{
$('#modules_list_container_tab').slideDown();
$('#modules_list_loader').hide();
}
return false;
}
{/if}
//]]>
</script>
{/block}
</div>