// Localization Bootstrap design

This commit is contained in:
Jerome Nadaud
2013-09-26 11:36:28 +02:00
parent 10e472e141
commit b9ccfe858b
13 changed files with 326 additions and 241 deletions
@@ -22,109 +22,132 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<tbody>
{foreach $list AS $index => $tr}
<tr
{if $position_identifier}id="tr_{$id_category}_{$tr.$identifier}_{$tr.position['position']}"{/if}
{if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{/if}
>
<td>
{if $bulk_actions}
{assign var=bulkActionPossible value=true}
{foreach $list_skip_actions as $key => $value}
{if in_array($tr.$identifier, $value) == true}
{assign var=bulkActionPossible value=false}
{/if}
{/foreach}
{if $bulkActionPossible == true}
<input type="checkbox" name="{$table}Box[]" value="{$tr.$identifier}" class="noborder" />
<tbody>
{foreach $list AS $index => $tr}
<tr
{if $position_identifier}id="tr_{$id_category}_{$tr.$identifier}_{$tr.position['position']}"{/if}
{if isset($tr.color) && $color_on_bg}style="background-color: {$tr.color}"{/if}
>
<td>
{if $bulk_actions}
{assign var=bulkActionPossible value=true}
{foreach $list_skip_actions as $key => $value}
{if in_array($tr.$identifier, $value) == true}
{assign var=bulkActionPossible value=false}
{/if}
{/foreach}
{if $bulkActionPossible == true}
<input type="checkbox" name="{$table}Box[]" value="{$tr.$identifier}" class="noborder" />
{/if}
</td>
{foreach $fields_display AS $key => $params}
<td
{if isset($params.position)}
id="td_{if $id_category}{$id_category}{else}0{/if}_{$tr.$identifier}"
{/if}
class="{if !$no_link}pointer{/if}
{if isset($params.position) && $order_by == 'position'} dragHandle{/if}
{if isset($params.align)} {$params.align}{/if}"
{/if}
</td>
{foreach $fields_display AS $key => $params}
<td
{if isset($params.position)}
id="td_{if $id_category}{$id_category}{else}0{/if}_{$tr.$identifier}"
{/if}
class="{if !$no_link}pointer{/if}
{if isset($params.position) && $order_by == 'position'} dragHandle{/if}
{if isset($params.align)} {$params.align}{/if}"
{if (!isset($params.position) && !$no_link)}
onclick="document.location = '{$current_index}&{$identifier}={$tr.$identifier}{if $view}&view{else}&update{/if}{$table}&token={$token}'">{if isset($params.prefix)}{$params.prefix}{/if}
{if (!isset($params.position) && !$no_link)}
onclick="document.location = '{$current_index}&{$identifier}={$tr.$identifier}{if $view}&view{else}&update{/if}{$table}&token={$token}'">{if isset($params.prefix)}{$params.prefix}{/if}
{else}
>
{/if}
{if isset($params.active)}
{$tr.$key}
{elseif isset($params.activeVisu)}
<img src="../img/admin/{if $tr.$key}enabled.gif{else}disabled.gif{/if}"
alt="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" title="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" />
{elseif isset($params.position)}
{if $order_by == 'position' && $order_way != 'DESC'}
<a href="{$tr.$key.position_url_down}" {if !($tr.$key.position != $positions[count($positions) - 1])}style="display: none;"{/if}>
<img src="../img/admin/{if $order_way == 'ASC'}down{else}up{/if}.gif" alt="{l s='Down'}" title="{l s='Down'}" />
</a>
<a href="{$tr.$key.position_url_up}" {if !($tr.$key.position != $positions.0)}style="display: none;"{/if}>
<img src="../img/admin/{if $order_way == 'ASC'}up{else}down{/if}.gif" alt="{l s='Up'}" title="{l s='Up'}" />
</a>
{else}
>
{$tr.$key.position + 1}
{/if}
{if isset($params.active)}
{$tr.$key}
{elseif isset($params.activeVisu)}
<img src="../img/admin/{if $tr.$key}enabled.gif{else}disabled.gif{/if}"
alt="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" title="{if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if}" />
{elseif isset($params.position)}
{if $order_by == 'position' && $order_way != 'DESC'}
<a href="{$tr.$key.position_url_down}" {if !($tr.$key.position != $positions[count($positions) - 1])}style="display: none;"{/if}>
<img src="../img/admin/{if $order_way == 'ASC'}down{else}up{/if}.gif" alt="{l s='Down'}" title="{l s='Down'}" />
</a>
<a href="{$tr.$key.position_url_up}" {if !($tr.$key.position != $positions.0)}style="display: none;"{/if}>
<img src="../img/admin/{if $order_way == 'ASC'}up{else}down{/if}.gif" alt="{l s='Up'}" title="{l s='Up'}" />
</a>
{else}
{$tr.$key.position + 1}
{elseif isset($params.image)}
{$tr.$key}
{elseif (isset($params.icon))}
<img src="../img/admin/{$tr[$key]}" alt="{$tr[$key]}" title="{$tr[$key]}" />
{elseif isset($params.price)}
{$tr.$key}
{elseif isset($params.float)}
{$tr.$key}
{elseif isset($params.type) && $params.type == 'date'}
{$tr.$key}
{elseif isset($params.type) && $params.type == 'datetime'}
{$tr.$key}
{elseif isset($params.callback)}
{$tr.$key}
{elseif isset($tr.$key)}
{if $key == 'behavior'}
{if $tr.$key == 0}
{l s='This tax only'}
{elseif $tr.$key == 1}
{l s='Compute with others'}
{elseif $tr.$key == 2}
{l s='One after another'}
{/if}
{elseif isset($params.image)}
{$tr.$key}
{elseif (isset($params.icon))}
<img src="../img/admin/{$tr[$key]}" alt="{$tr[$key]}" title="{$tr[$key]}" />
{elseif isset($params.price)}
{$tr.$key}
{elseif isset($params.float)}
{$tr.$key}
{elseif isset($params.type) && $params.type == 'date'}
{$tr.$key}
{elseif isset($params.type) && $params.type == 'datetime'}
{$tr.$key}
{elseif isset($params.callback)}
{$tr.$key}
{elseif isset($tr.$key)}
{if $key == 'behavior'}
{if $tr.$key == 0}
{l s='This tax only'}
{elseif $tr.$key == 1}
{l s='Compute with others'}
{elseif $tr.$key == 2}
{l s='One after another'}
{/if}
{elseif $key == 'rate'}
{$tr.$key|string_format:"%.2f"}%
{elseif $key == 'zipcode'}
{if $tr.$key == '0 - 0'}
--
{else}
{$tr.$key|escape:'htmlall':'UTF-8'}
{/if}
{elseif $key == 'rate'}
{$tr.$key|string_format:"%.2f"}%
{elseif $key == 'zipcode'}
{if $tr.$key == '0 - 0'}
--
{else}
{$tr.$key|escape:'htmlall':'UTF-8'}
{/if}
{else}
--
{$tr.$key|escape:'htmlall':'UTF-8'}
{/if}
{if isset($params.suffix)}{$params.suffix}{/if}
</td>
{/foreach}
{if $shop_link_type}
<td {if $name != $tr.shop_name}title="{$tr.shop_name}"{/if}>{if isset($tr.shop_short_name)}{$tr.shop_short_name}{else}{$tr.shop_name}{/if}</td>
{/if}
{if $has_actions}
<td>
{foreach $actions AS $action}
{if isset($tr.$action)}
{$tr.$action}
{/if}
{/foreach}
{else}
--
{/if}
{if isset($params.suffix)}{$params.suffix}{/if}
</td>
{/if}
</tr>
{/foreach}
</tbody>
{/foreach}
{if $shop_link_type}
<td {if $name != $tr.shop_name}title="{$tr.shop_name}"{/if}>{if isset($tr.shop_short_name)}{$tr.shop_short_name}{else}{$tr.shop_name}{/if}</td>
{/if}
{if $has_actions}
<td class="text-right fixed-width-lg">
{assign var='compiled_actions' value=array()}
{foreach $actions AS $key => $action}
{if isset($tr.$action)}
{if $key == 0}
{assign var='action' value=$action}
{/if}
{$compiled_actions[] = $tr.$action}
{/if}
{/foreach}
{if $compiled_actions|count > 0}
<div class="btn-group{if $compiled_actions|count > 1} btn-group-action{/if}">
{$compiled_actions[0]|regex_replace:'/class\s*=\s*"(\w*)"/':'class="$1 btn btn-default"'}
{if $compiled_actions|count > 1}
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>&nbsp;
</button>
<ul class="dropdown-menu">
{foreach $compiled_actions AS $key => $action}
{if $key != 0}
<li>
{$action}
</li>
{/if}
{/foreach}
</ul>
{/if}
</div>
{/if}
</td>
{/if}
</tr>
{/foreach}
</tbody>
@@ -0,0 +1,104 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
</table>
</div>
{if $bulk_actions}
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{l s='Bulk actions'} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li>
<a href="#" onclick="javascript:checkDelBoxes($(this).closest('form').get(0), '{$table}Box[]', true);return false;">
<i class="icon-check-sign"></i>&nbsp;{l s='Select all'}
</a>
</li>
<li>
<a href="#" onclick="javascript:checkDelBoxes($(this).closest('form').get(0), '{$table}Box[]', false);return false;">
<i class="icon-check-empty"></i>&nbsp;{l s='Unselect all'}
</a>
</li>
<li class="divider"></li>
{foreach $bulk_actions as $key => $params}
<li{if $params.text == 'divider'} class="divider"{/if}>
{if $params.text != 'divider'}
<a href="#" onclick="{if isset($params.confirm)}if (confirm('{$params.confirm}')){/if}sendBulkAction($(this).closest('form').get(0), 'submitBulk{$key}{$table}');">
{if isset($params.icon)}<i class="{$params.icon}"></i>{/if}&nbsp;{$params.text}
</a>
{/if}
</li>
{/foreach}
</ul>
</div>
{/if}
{if !$simple_header && $list_total > 20}
<div class="table-pagination pull-right">
<span>
{if $page > 1}
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$table}').value=1"/>&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$table}').value={$page - 1}"/>
{/if}
{l s='Page'} <b>{$page}</b> / {$total_pages}
{if $page < $total_pages}
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$table}').value={$page + 1}"/>&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$table}').value={$total_pages}"/>
{/if}
</span>
<span>
&nbsp;|&nbsp;
<label >{l s='Display'}</label>
<select class="filter fixed-width-xs" name="pagination" onchange="submit()">
{* Choose number of results per page *}
{foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
{/foreach}
</select>
</span>
<span> / {$list_total} {l s='result(s)'}</span>
</div>
{/if}
{if !$simple_header}
<input type="hidden" name="token" value="{$token}" />
</fieldset>
</form>
{/if}
{hook h='displayAdminListAfter'}
{if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}ListAfter{/capture}
{hook h=$hookName}
{elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}ListAfter{/capture}
{hook h=$hookName}
{/if}
{block name="after"}{/block}
@@ -33,81 +33,48 @@
{/if}
<form method="post" action="{$currentIndex}&{$identifier}&token={$token}&id_tax_rules_group={$id_tax_rules_group}&updatetax_rules_group#{$table}" class="form">
<fieldset>
<input type="hidden" id="submitFilter{$list_id}" name="submitFilter{$list_id}" value="0"/>
<table class="table_grid">
<tr>
<td style="vertical-align: bottom;">
<span style="float: left;">
{if $page > 1}
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$list_id}').value=1"/>&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$list_id}').value={$page - 1}"/>
{/if}
{l s='Page'} <b>{$page}</b> / {$total_pages}
{if $page < $total_pages}
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$list_id}').value={$page + 1};"/>&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$list_id}').value={$total_pages}"/>
{/if}
| {l s='Display'}
<select name="{$list_id}_pagination" onchange="submit()">
{* Choose number of results per page *}
{foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
{/foreach}
</select>
/ {$list_total} {l s='result(s)'}
</span>
<span style="float: right;">
<input type="submit" name="submitReset{$list_id}" value="{l s='Reset'}" class="button" />
</span>
<span class="clear"></span>
</td>
</tr>
<tr>
<td>
<table
{if $table_id} id={$table_id}{/if}
class="table {if $table_dnd}tableDnD{/if} {$list_id}"
cellpadding="0" cellspacing="0"
style="width: 100%; margin-bottom:10px;"
>
<col width="10px" />
<div class="table-responsive clearfix">
<table
{if $table_id} id={$table_id}{/if}
class="table {if $table_dnd}tableDnD{/if} {$list_id}">
<col width="10px" />
{foreach $fields_display AS $key => $params}
<col {if isset($params.width) && $params.width != 'auto'}width="{$params.width}px"{/if}/>
{/foreach}
{if $shop_link_type}
<col width="80px" />
{/if}
{if $has_actions}
<col width="52px" />
{/if}
<thead>
<tr class="nodrag nodrop">
<th class="center">
</th>
{foreach $fields_display AS $key => $params}
<col {if isset($params.width) && $params.width != 'auto'}width="{$params.width}px"{/if}/>
<th{if isset($params.align)} align="{$params.align}"{/if}{if isset($params.class)} class="{$params.class}"{/if}>
{if isset($params.hint)}<span class="hint" name="help_box">{$params.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
<span class="title_box">
{$params.title}
</span>
</th>
{/foreach}
{if $shop_link_type}
<col width="80px" />
<th>
{if $shop_link_type == 'shop'}
{l s='Shop'}
{else}
{l s='Group shop'}
{/if}
</th>
{/if}
{if $has_actions}
<col width="52px" />
<th class="actions text-right"><button type="submit" name="submitReset{$list_id}" class="btn btn-warning">
<i class="icon-eraser"></i> {l s='Reset'}
</button>
</th>
{/if}
<thead>
<tr class="nodrag nodrop">
<th class="center">
{if $has_bulk_actions}
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$list_id}Box[]', this.checked)" />
{/if}
</th>
{foreach $fields_display AS $key => $params}
<th {if isset($params.align)} class="{$params.align}"{/if}>
{if isset($params.hint)}<span class="hint" name="help_box">{$params.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
<span class="title_box">
{$params.title}
</span>
<br />&nbsp;
</th>
{/foreach}
{if $shop_link_type}
<th>
{if $shop_link_type == 'shop'}
{l s='Shop'}
{else}
{l s='Group shop'}
{/if}
<br />&nbsp;
</th>
{/if}
{if $has_actions}
<th class="center">{l s='Actions'}<br />&nbsp;</th>
{/if}
</tr>
</thead>
</tr>
</thead>
@@ -1,29 +0,0 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/form/form.tpl"}
{block name="after"}
<br />
{/block}
@@ -96,22 +96,20 @@
<div class="row">
<label class="control-label col-lg-3" for="language-button">{l s='Select your language:'}</label>
<div class="input-group col-lg-4">
<div class="input-group-btn">
<button type="button" id="language-button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{l s='Language'}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach $languages as $language}
<li>
<a href="javascript:chooseTypeTranslation('{$language['iso_code']}');">
<img src="{$theme_lang_dir}{$language['id_lang']}.jpg" alt="{$language['iso_code']}" title="{$language['iso_code']}" />
{$language['iso_code']}
</a>
</li>
{/foreach}
</ul>
</div>
<button type="button" id="language-button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
{l s='Language'}
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
{foreach $languages as $language}
<li>
<a href="javascript:chooseTypeTranslation('{$language['iso_code']}');">
<img src="{$theme_lang_dir}{$language['id_lang']}.jpg" alt="{$language['iso_code']}" title="{$language['iso_code']}" />
{$language['iso_code']}
</a>
</li>
{/foreach}
</ul>
</div>
<input type="hidden" name="token" value="{$token}" />
</div>
@@ -233,7 +231,7 @@
<p class="alert alert-warning">
{l s='Copies data from one language to another.'}<br />
{l s='Warning: This will replace all of the existing data inside the destination language.'}<br />
{l s='If necessary'}, <b><a href="{$url_create_language}">{l s='you must first create a new language.'}</a></b>.
{l s='If necessary'}, <b><a href="{$url_create_language}" class="btn btn-link"><i class="icon-external-link-sign"></i> {l s='you must first create a new language.'}</a></b>.
</p>
<div class="row">
<label class="control-label col-lg-3 required" for="fromLang"> {l s='From:'}</label>