// update module tab positions & payment

This commit is contained in:
sLorenzini
2013-07-15 11:55:06 +02:00
parent b8babdadb3
commit 0c4a5bd984
6 changed files with 157 additions and 114 deletions
@@ -24,64 +24,71 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<tr class="{$class_row}">
<td>
<table border="0" cellpadding="0" cellspacing="5">
<tr>
<td valign="top" width="32" align="center">
<img width="57" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}">
</td>
<td height="60" valign="top">
<div id="anchor{$module->name|ucfirst}">
<h4>
{$module->displayName|truncate:40:'…'} {$module->version}
{if isset($module->id) && $module->id gt 0 }
{if $module->active}
<span class="label label-success">{l s='Enabled'}</span>
{else}
<span class="label label-warning">{l s='Disabled'}</span>
{/if}
{else}
{if isset($module->type) && $module->type == 'addonsMustHave'}
<span class="label label-danger">{l s='Must Have'}</span>
{else}
<span class="label label-warning">{l s='Not installed'}</span>
{/if}
{/if}
</h4>
<p>
{if isset($module->description) && $module->description ne ''}
{$module->description|truncate:100:'…'}
{else}
&nbsp;
{/if}
</p>
</div>
</td>
<td border="0" valign="middle" align="right">
<div id="list-action-button" class="row-light">
{if isset($module->type) && $module->type == 'addonsMustHave'}
<p>
<a href="{$module->addons_buy_url}" target="_blank" class="button updated">
<span class="btn btn-default">
<i class="icon-shopping-cart"></i> &nbsp;&nbsp;{displayPrice price=$module->price currency=$module->id_currency}
</span>
</a>
</p>
{else if !isset($module->not_on_disk)}
{$module->optionsHtml}
<p>
<a href="#" class="btn btn-default action_tab_module" data-option="select_{$module->name}">{l s='Submit'}</a>
</p>
{else}
<p>
<a href="{$module->options.install_url}" class="btn btn-default">{l s='Install'}</a>
</p>
{/if}
</div>
</td>
</tr>
</table>
<tr>
<td class="center">
<img width="57" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}">
</td>
</tr>
<td>
<div id="anchor{$module->name|ucfirst}">
<h4>
{$module->displayName|truncate:40:'…'} {$module->version}
{if isset($module->id) && $module->id gt 0 }
{if $module->active}
<span class="label label-success">{l s='Enabled'}</span>
{else}
<span class="label label-warning">{l s='Disabled'}</span>
{/if}
{else}
{if isset($module->type) && $module->type == 'addonsMustHave'}
<span class="label label-danger">{l s='Must Have'}</span>
{else}
<span class="label label-warning">{l s='Not installed'}</span>
{/if}
{/if}
</h4>
<p>
{if isset($module->description) && $module->description ne ''}
{$module->description|truncate:100:'…'}
{else}
&nbsp;
{/if}
</p>
</div>
</td>
{if isset($module->type) && $module->type == 'addonsMustHave'}
<td>&nbsp;</td>
<td align="right">
<p>
<a href="{$module->addons_buy_url}" target="_blank" class="button updated">
<span class="btn btn-default">
<i class="icon-shopping-cart"></i> &nbsp;&nbsp;{displayPrice price=$module->price currency=$module->id_currency}
</span>
</a>
</p>
</td>
{else if !isset($module->not_on_disk)}
<td>
<p>{$module->optionsHtml}</p>
</td>
<td align="right">
<p>
<a href="#" class="btn btn-default action_tab_module" data-option="select_{$module->name}">
<i class="icon-ok"></i>
{l s='Submit'}
</a>
</p>
</td>
{else}
<td>&nbsp;</td>
<td align="right">
<p>
<a href="{$module->options.install_url}" class="btn btn-default">
<i class="icon-plus-sign-alt"></i>
{l s='Install'}
</a>
</p>
</td>
{/if}
</tr>
@@ -120,10 +120,10 @@
<td colspan="3">
<div class="lab_modules_positions" for="mod{$hook['id_hook']}_{$module['instance']->id}">
{/if}
<h3>
<h4>
<img src="../modules/{$module['instance']->name}/logo.png" alt="{$module['instance']->name|stripslashes}" />
{$module['instance']->displayName|stripslashes}
</h3>
</h4>
<dl class="dl-horizontal">
<dt>{l s='Version:'}</dt>
<dd>
@@ -170,7 +170,14 @@
</table>
</div>
{/foreach}
<div id="unhook_button_position_bottom"><input class="button floatr" type="submit" name="unhookform" value="{l s='Unhook the selection'}"/></div>
<div id="unhook_button_position_bottom">
<span class="pull-right">
<button type="submit" class="btn btn-default" name="unhookform">
<i class="icon-minus-sign-alt"></i>
{l s='Unhook the selection'}
</button>
</span>
</div>
</form>
</div>
<div class="col-lg-3">
@@ -33,7 +33,7 @@
{/if}
{if $display_restrictions}
<h2 class="space">{l s='Payment module restrictions'}</h2>
<legend>{l s='Payment module restrictions'}</legend>
{foreach $lists as $list}
{include file='controllers/payment/restrictions.tpl'}
{/foreach}
@@ -23,16 +23,16 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<form action="{$url_submit}" method="post" id="form_{$list['name_id']}">
<fieldset>
<legend><img src="../img/admin/{$list['icon']}.gif" />{$list['title']}</legend>
<p>{$list['desc']}<p>
<table cellpadding="0" cellspacing="0" class="table">
<form action="{$url_submit}" method="post" id="form_{$list['name_id']}" class="form-horizontal">
<fieldset class="well">
<legend><img src="../img/admin/{$list['icon']}.gif" />&nbsp;{$list['title']}</legend>
<p class="help-block">{$list['desc']}</p>
<table cellpadding="0" cellspacing="0" class="table table-striped table-hover">
<tr>
<th style="width: 200px">{$list['title']}</th>
<th width="20%">{$list['title']}</th>
{foreach $payment_modules as $module}
{if $module->active}
<th>
<th class="center">
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
<input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked">
<a href="javascript:checkPaymentBoxes('{$list['name_id']}', '{$module->name}')" style="text-decoration:none;">
@@ -47,53 +47,79 @@
</tr>
{foreach $list['items'] as $item}
<tr class="{cycle values=",alt_row"}">
<td>{$item['name']}</td>
{foreach $payment_modules as $key_module => $module}
{if $module->active}
<td style="text-align: center">
{assign var='type' value='null'}
{if !$item['check_list'][$key_module]}
{* Keep $type to null *}
{elseif $list['name_id'] === 'currency'}
{if $module->currencies && $module->currencies_mode == 'checkbox'}
<td>
<span>{$item['name']}</span>
</td>
{foreach $payment_modules as $key_module => $module}
{if $module->active}
<td class="center">
{assign var='type' value='null'}
{if !$item['check_list'][$key_module]}
{* Keep $type to null *}
{elseif $list['name_id'] === 'currency'}
{if $module->currencies && $module->currencies_mode == 'checkbox'}
{$type = 'checkbox'}
{elseif $module->currencies && $module->currencies_mode == 'radio'}
{$type = 'radio'}
{/if}
{else}
{$type = 'checkbox'}
{elseif $module->currencies && $module->currencies_mode == 'radio'}
{$type = 'radio'}
{/if}
{else}
{$type = 'checkbox'}
{/if}
{if $type != 'null'}
<input type="checkbox" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"
{if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}
/>
{else}
--
{/if}
</td>
{/if}
{/foreach}
{if $type != 'null'}
<input type="checkbox" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"
{if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}
/>
{else}
--
{/if}
</td>
{/if}
{/foreach}
</tr>
{/foreach}
{if $list['name_id'] === 'currency'}
<tr class="{cycle values=",alt_row"}">
<td>{l s='Customer currency'}</td>
<td>
<span>{l s='Customer currency'}</span>
</td>
{foreach $payment_modules as $module}
{if $module->active}
<td style="text-align: center">{if $module->currencies && $module->currencies_mode == 'radio'}<input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-1"{if in_array(-1, $module->$list['name_id'])} checked="checked"{/if} />{else}--{/if}</td>
<td class="center">
{if $module->currencies && $module->currencies_mode == 'radio'}
<input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-1"{if in_array(-1, $module->$list['name_id'])} checked="checked"
{/if} />
{else}
--
{/if}
</td>
{/if}
{/foreach}
</tr>
<tr class="{cycle values=",alt_row"}">
<td>{l s='Shop default currency'}</td>
<td>
<span>{l s='Shop default currency'}</span>
</td>
{foreach $payment_modules as $module}
{if $module->active}
<td style="text-align: center">{if $module->currencies && $module->currencies_mode == 'radio'}<input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-2"{if in_array(-2, $module->$list['name_id'])} checked="checked"{/if} />{else}--{/if}</td>
<td class="center">
{if $module->currencies && $module->currencies_mode == 'radio'}
<input type="radio" name="{$module->name}_{$list['name_id']}[]" value="-2"{if in_array(-2, $module->$list['name_id'])} checked="checked"
{/if}
/>
{else}
--
{/if}
</td>
{/if}
{/foreach}
</tr>
{/if}
</table>
<div><input type="submit" class="button space" name="submitModule{$list['name_id']}" value="{l s='Save restrictions'}" /></div>
<p class="text-right">
<button type="submit" class="btn btn-default" name="submitModule{$list['name_id']}">
<i class="icon-ok"></i>
{l s='Save restrictions'}
</button>
</p>
</fieldset>
</form>
@@ -23,24 +23,26 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<h2 style="margin-top:0">{l s='Modules list'}</h2>
<div id="modules_list_container_tab" class="default_modules_list_display_type">
<ul id="modules_list_container_content">
<legend>{l s='Modules list'}</legend>
<div id="modules_list_container_tab" class="row">
<div class="col-lg-12">
{if count($modules_list)}
<li>
<table border="0" cellpadding="0" cellspacing="5" class="table table-striped table-hover">
{counter start=1 assign="count"}
{foreach from=$modules_list item=module}
<div style="width:400px">{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}}</div>
{if $count %2 == 0}
</li>
<li>
{/if}
{foreach from=$modules_list item=module}
{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}}
{if $count %2 == 0}{/if}
{counter}
{/foreach}
</li>
</table>
{else}
<tr><td><div style="font-weight:700;margin-top:20px">{l s='No modules available in this section.'}</b></td></tr>
<table border="0" cellpadding="0" cellspacing="5" class="table table-striped table-hover">
<tr>
<td>
<div class="alert alert-block">{l s='No modules available in this section.'}</div>
</td>
</tr>
</table>
{/if}
</ul>
</div>
</div>
<div class="clear"></div>