// Module List + some design WIP

This commit is contained in:
Kevin Granger
2013-08-05 20:42:14 +02:00
parent 6533ee4bec
commit bdc9d77c09
9 changed files with 649 additions and 606 deletions
@@ -23,93 +23,26 @@
* International Registered Trademark & Property of PrestaShop SA
*}
{if $add_permission eq '1'}
{if isset($logged_on_addons)}
<!--start addons login-->
<div id="addons_login_div" class="row" >
<div class="col-lg-12">
<h3>
<i class="icon-user"></i>
{l s='You are logged into PrestaShop Addons.'}
</h3>
<div class="row">
<label class="control-label col-lg-9">
<i class="icon-user"></i> {l s='Welcome'} {$username_addons}
</label>
<label class="control-label col-lg-3">
<a href="#" id="addons_logout_button">
<i class="icon-signout"></i> {l s='Log out from PrestaShop Addons.'}
</a>
</label>
</div>
</div>
</div>
<!--end addons login-->
{else}
{if $check_url_fopen eq 'ko' OR $check_openssl eq 'ko'}
<div class="alert alert-block">
<b>{l s='If you want to be able to fully use the AdminModules panel and have free modules available, you should enable the following configuration on your server:'}</b><br />
{if $check_url_fopen eq 'ko'}- {l s='Enable allow_url_fopen'}<br />{/if}
{if $check_openssl eq 'ko'}- {l s='Enable php openSSL extension'}<br />{/if}
</div>
{else}
<!--start addons login-->
<div id="addons_login_div" class="row">
<div class="col-lg-12">
<form id="addons_login_form" method="post" class="form-horizontal">
<h3>
<i class="icon-user"></i>
{l s='Do you have a %s account?' sprintf='<a href="http://addons.prestashop.com/">PrestaShop Addons</a>'}
</h3>
<div class="row">
<label class="control-label col-lg-3">{l s='Addons Login'} :</label>
<div class="input-group col-lg-4">
<span class="input-group-addon"><i class="icon-user"></i></span>
<input type="text" value="" id="username_addons" autocomplete="off" class="ac_input">
</div>
</div>
<div class="row">
<label class="control-label col-lg-3">{l s= 'Password Addons'} :</label>
<div class="input-group col-lg-4">
<span class="input-group-addon"><i class="icon-key"></i></span>
<input type="password" value="" id="password_addons" autocomplete="off" class="ac_input">
</div>
</div>
<div class="row">
<div class="col-lg-10 col-offset-3">
<button class="btn btn-default" id="addons_login_button" type="submit">
<i class="icon-unlock"></i> {l s='Log in'}
</button>
<div id="addons_loading" class="help-block"></div>
</div>
</div>
</form>
</div>
</div>
<!--end addons login-->
{/if}
{/if}
{/if}
<!--start filter module-->
<div class="well">
<form id="filternameForm" method="post" class="form-horizontal">
<div class="row">
<div class="input-group col-lg-4">
<input type="text" value="" name="filtername" autocomplete="off" class="ac_input">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<i class="icon-search"></i> {l s='Search'}
</button>
</span>
</div>
<div class="row">
<div class="col-lg-6">
<form id="filternameForm" method="post" class="form-horizontal">
<div class="input-group col-lg-12">
<input type="text" value="" name="filtername" autocomplete="off" class="ac_input">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">
<i class="icon-search"></i> {l s='Search'}
</button>
</span>
</div>
</form>
</div>
</form>
<form method="post" class="form-inline">
<label>{l s='Sort by'}:</label>
<span>
<select class="filter fixed-width-XL" name="module_type" id="module_type_filter" {if $showTypeModules ne 'allModules' && $showTypeModules ne ''}style="background-color:#49B2FF;color:white;"{/if}>
<div class="col-lg-6">
<form method="post" class="form-inline pull-right">
<label>{l s='Sort by'}</label>
<!-- <span>
<select class="filter fixed-width-L" name="module_type" id="module_type_filter" {if $showTypeModules ne 'allModules' && $showTypeModules ne ''}style="background-color:#49B2FF;color:white;"{/if}>
<option value="allModules" {if $showTypeModules eq 'allModules'}selected="selected"{/if}>{l s='All Modules'}</option>
<option value="nativeModules" {if $showTypeModules eq 'nativeModules'}selected="selected"{/if}>{l s='Free Modules'}</option>
<option value="partnerModules" {if $showTypeModules eq 'partnerModules'}selected="selected"{/if}>{l s='Partner Modules (Free)'}</option>
@@ -122,29 +55,29 @@
</optgroup>
<option value="otherModules" {if $showTypeModules eq 'otherModules'}selected="selected"{/if}>{l s='Other Modules'}</option>
</select>
</span>
</span> -->
<span>
<select class="filter fixed-width-XL" name="module_install" id="module_install_filter" {if $showInstalledModules ne 'installedUninstalled' && $showInstalledModules ne ''}style="background-color:#49B2FF;color:white;"{/if}>
<select class="filter fixed-width-L" name="module_install" id="module_install_filter" {if $showInstalledModules ne 'installedUninstalled' && $showInstalledModules ne ''}style="background-color:#49B2FF;color:white;"{/if}>
<option value="installedUninstalled" {if $showInstalledModules eq 'installedUninstalled'}selected="selected"{/if}>{l s='Installed & Not Installed'}</option>
<option value="installed" {if $showInstalledModules eq 'installed'}selected="selected"{/if}>{l s='Installed Modules'}</option>
<option value="uninstalled" {if $showInstalledModules eq 'uninstalled'}selected="selected"{/if}>{l s='Modules Not Installed '}</option>
</select>
</span>
<span>
<select class="filter fixed-width-XL" name="module_status" id="module_status_filter" {if $showEnabledModules ne 'enabledDisabled' && $showEnabledModules ne ''}style="background-color:#49B2FF;color:white;"{/if}>
<select class="filter fixed-width-L" name="module_status" id="module_status_filter" {if $showEnabledModules ne 'enabledDisabled' && $showEnabledModules ne ''}style="background-color:#49B2FF;color:white;"{/if}>
<option value="enabledDisabled" {if $showEnabledModules eq 'enabledDisabled'}selected="selected"{/if}>{l s='Enabled & Disabled'}</option>
<option value="enabled" {if $showEnabledModules eq 'enabled'}selected="selected"{/if}>{l s='Enabled Modules'}</option>
<option value="disabled" {if $showEnabledModules eq 'disabled'}selected="selected"{/if}>{l s='Disabled Modules'}</option>
</select>
</span>
<span>
<!-- <span>
<select class="filter fixed-width-XL" name="country_module_value" id="country_module_value_filter" {if $showCountryModules eq 1}style="background-color:#49B2FF;color:white;"{/if}>
<option value="0" >{l s='All countries'}</option>
<option value="1" {if $showCountryModules eq 1}selected="selected"{/if}>{l s='Current country:'} {$nameCountryDefault}</option>
</select>
</span>
<span class="pull-right">
<button class="btn btn-small" type="submit" name="resetFilterModules">
</span> -->
<!-- <span class="pull-right">
<button class="btn btn-default btn-small" type="submit" name="resetFilterModules">
<i class="icon-eraser"></i>
{l s='Reset'}
</button>
@@ -152,7 +85,17 @@
<i class="icon-filter"></i>
{l s='Filter'}
</button>
</span>
</span> -->
</form>
</div>
</div>
</div>
<!--end filter module-->
@@ -24,28 +24,25 @@
*}
{if count($modules)}
<div class="row-fluid">
<span class="pull-right">
<button type="button" class="btn btn-default" onclick="modules_management('install')">
<i class="icon-plus-sign-alt"></i>
{l s='Install the selection'}
</button>
<button type="button" class="btn btn-default" onclick="modules_management('uninstall')">
<i class="icon-minus-sign-alt"></i>
{l s='Uninstall the selection'}
</button>
</span>
</div>
<table cellspacing="0" cellpadding="0" class="table table-striped table-hover">
<table id="module-list" class="table">
<thead>
<tr class="nodrag nodrop">
<tr>
<th width="1%">
<input type="checkbox" rel="false" class="noborder" id="checkme">
</th>
<th width="20%">{l s='Logo'}</th>
<th width="45%">{l s='Module name'}</th>
<th width="35%">&nbsp;</th>
</tr>
<th colspan="3">
<div class="btn-group pull-right">
<a class="btn btn-default btn-small" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}">
<i class="icon-list"></i>
{l s='Normal view'}
</a>
<a class="btn btn-default btn-small" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites">
<i class="icon-star"></i>
{l s='Favorites view'}
</a>
</div>
</th>
</tr>
<tbody>
{foreach from=$modules item=module}
<tr>
@@ -61,109 +58,94 @@
</td>
<td>
<div id="anchor{$module->name|ucfirst}">
<h4>{$module->displayName}
<h3 class="module-title">
{$module->displayName}
{if isset($module->type) && $module->type == 'addonsMustHave'}
<span class="label label-danger">{l s='Must Have'}</span>
{else}
{if isset($module->id) && $module->id gt 0}
<span class="label label-success{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>
{else}
<span class="label label-warning">{l s='Not installed'}</span>
{/if}
<span class="label label-info">{l s='Must Have'}</span>
{/if}
</h4>
<!-- {if isset($module->id) && $module->id gt 0}
<span class="label label-success{if isset($module->active) && $module->active eq 0} off{/if}">{l s='Installed'}</span>
{else}
<span class="label label-warning">{l s='Not installed'}</span>
{/if} -->
</h3>
<div class="row-fluid">
<dl class="dl-horizontal">
<p class="module-infos">
<span>{$module->categoryName}</span> -
{if isset($module->author) && !empty($module->author)}
<dt>{l s='Developed by'} :</dt>
<dd>{$module->author|truncate:20:'...'}</dd>
{l s='Developed by'} {$module->author|truncate:20:'...'}
{/if}
<dt>{l s='Version'} :</dt>
<dd>{$module->version}
{if isset($module->version_addons)}({l s='Update'} {$module->version_addons} {l s='Available on PrestaShop Addons'}){/if}
</dd>
<dt>{l s='Category'} :</dt>
<dd>{$module->categoryName}</dd>
&nbsp;- {l s='Version'} : {$module->version}
{if isset($module->version_addons)}
({l s='Update'} {$module->version_addons} {l s='Available on PrestaShop Addons'})
{/if}
</p>
<p class="module-description">
{if isset($module->description) && $module->description ne ''}
<dt>{l s='Description'} :</dt>
<dd>{$module->description}</dd>
{else}
&nbsp;
{l s='Description'} : {$module->description}
{/if}
</dl>
</p>
</div>
{if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="alert">{$module->message}</div>{/if}
{if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="alert alert-success">{$module->message}</div>{/if}
</div>
</td>
<td>
<div id="list-action-button" class="row-light">
<div class="btn-group">
{if isset($module->type) && $module->type == 'addonsMustHave'}
<a href="{$module->addons_buy_url}" target="_blank">
<span class="btn btn-default">
<i class="icon-shopping-cart"></i> &nbsp;&nbsp;{if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}
</span>
<td width="180px">
<div id="list-action-button" class="btn-group">
{if isset($module->type) && $module->type == 'addonsMustHave'}
<a class="btn btn-default" href="{$module->addons_buy_url}" target="_blank">
<i class="icon-shopping-cart"></i> &nbsp;{if isset($module->id_currency) && isset($module->price)}{displayPrice price=$module->price currency=$module->id_currency}{/if}
</a>
{else}
{if $module->id && isset($module->version_addons) && $module->version_addons}
<a class="btn btn-warning" href="{$module->options.update_url}">
<i class="icon-refresh"></i> {l s='Update it!'}
</a>
{else}
{if $module->id && isset($module->version_addons) && $module->version_addons}
<a href="{$module->options.update_url}">
<span class="btn btn-warning">
<i class="icon-refresh"></i> {l s='Update it!'}
</span>
</a>
{/if}
<a class="btn {if isset($module->id) && $module->id gt 0}btn-danger{else}btn-success{/if}" {if isset($module->id) && $module->id gt 0 && !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}">
{if isset($module->id) && $module->id gt 0}
<i class="icon-minus-sign-alt"></i>
{l s='Uninstall'}
{else}
<i class="icon-plus-sign-alt"></i>
{l s='Install'}
{/if}
<a {if isset($module->id) && $module->id gt 0 && !empty($module->options.uninstall_onclick)}onclick="{$module->options.uninstall_onclick}"{/if} href="{if isset($module->id) && $module->id gt 0}{$module->options.uninstall_url}{else}{$module->options.install_url}{/if}" class="button installed">
{if isset($module->id) && $module->id gt 0}
<span class="btn btn-danger">
<i class="icon-minus-sign-alt"></i>
{l s='Uninstall'}
</span>
{else}
<span class="btn btn-success">
<i class="icon-plus-sign-alt"></i>
{l s='Install'}
</span>
{/if}
</a>
<div class="row-fluid btn-group btn-group-action">
{if !isset($module->not_on_disk)}
<span class="btn btn-default btn-small">
<i class="icon-cog"></i> {l s='Choose an action'}
</span>
<button data-toggle="dropdown" class="btn btn-default btn-small dropdown-toggle">
<span class="caret"></span>&nbsp;
</button>
<ul class="dropdown-menu">
{$module->optionsHtml}
{if isset($module->preferences) && isset($module->preferences['favorite']) && $module->preferences['favorite'] == 1}
<li>
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
</li>
<li>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
</li>
{else}
<li>
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
</li>
<li>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
</li>
{/if}
{else}
&nbsp;
{/if}
</div>
{/if}
</div>
</a>
{if !isset($module->not_on_disk)}
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" >
<span class="caret">&nbsp;</span>
</button>
<ul class="dropdown-menu">
{$module->optionsHtml}
{if isset($module->preferences) && isset($module->preferences['favorite']) && $module->preferences['favorite'] == 1}
<li>
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
</li>
<li>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
</li>
{else}
<li>
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">
<i class="icon-star"></i> {l s='Remove from Favorites'}
</a>
</li>
<li>
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">
<i class="icon-star"></i> {l s='Mark as Favorite'}
</a>
</li>
{/if}
</ul>
{else}
&nbsp;
{/if}
{/if}
</div>
</td>
</tr>
@@ -25,45 +25,40 @@
<div id="productBox">
{include file='controllers/modules/header.tpl'}
{include file='controllers/modules/filters.tpl'}
{include file='controllers/modules/login_addons.tpl'}
{if $upgrade_available|@count}
<div class="alert alert-info" style="display:block;">
{l s='An upgrade is available for some of your modules!'}
<ul>
{foreach from=$upgrade_available item='module'}
<li> &raquo; <a href="{$currentIndex|escape:htmlall}&token={$token|escape:htmlall}&anchor=anchor{$module.anchor|escape:htmlall}"><b>{$module.name|escape:htmlall}</b></a></li>
{/foreach}
</ul>
</div>
<div class="alert alert-info">
{l s='An upgrade is available for some of your modules!'}
<ul>
{foreach from=$upgrade_available item='module'}
<li> &raquo; <a href="{$currentIndex|escape:htmlall}&token={$token|escape:htmlall}&anchor=anchor{$module.anchor|escape:htmlall}"><b>{$module.name|escape:htmlall}</b></a></li>
{/foreach}
</ul>
</div>
{/if}
<div class="row">
<div class="col-lg-12">
<div class="btn-group pull-right">
<a class="btn btn-default" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}">
<i class="icon-list"></i>
{l s='Normal view'}
</a>
<a class="btn btn-default" href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites">
<i class="icon-star"></i>
{l s='Favorites view'}
</a>
<div class="panel">
<div class="panel-heading">
<i class="icon-list-ul"></i>
{l s='Modules list'}
</div>
</div>
<div id="container">
{include file='controllers/modules/filters.tpl'}
<!--start sidebar module-->
<div class="row-fluid">
<div class="categorieTitle col-lg-3">
<div class="row">
<div class="categorieTitle col col-lg-3">
<div class="list-group">
<h3>
<i class="icon-reorder"></i>
{l s='Categories'}
</h3>
<a class="list-group-item {if isset($categoryFiltered.favorites)}active{/if}" href="{$currentIndex}&token={$token}&filterCategory=favorites">
{l s='Favorites'} <span class="badge pull-right">{$nb_modules_favorites}</span>
<i class="icon-star"></i> {l s='Favorites'} <span class="badge pull-right">{$nb_modules_favorites}</span>
</a>
<a class="list-group-item {if count($categoryFiltered) lte 0}active{/if}" href="{$currentIndex}&token={$token}&unfilterCategory=yes">
{l s='Total'} <span class="badge pull-right">{$nb_modules}</span>
{l s='All'} <span class="badge pull-right">{$nb_modules}</span>
</a>
{foreach from=$list_modules_categories item=module_category key=module_category_key}
<a class="list-group-item {if isset($categoryFiltered[$module_category_key])}active{/if}" href="{$currentIndex}&token={$token}&{if isset($categoryFiltered[$module_category_key])}un{/if}filterCategory={$module_category_key}">
@@ -72,13 +67,10 @@
{/foreach}
</div>
</div>
</div>
<div id="moduleContainer" class="col-lg-9">
<h3>
<i class="icon-list-ul"></i>
{l s='Modules list'}
</h3>
{include file='controllers/modules/list.tpl'}
<div id="moduleContainer" class="col col-lg-9">
{include file='controllers/modules/list.tpl'}
</div>
</div>
</div>
</div>