[+] BO Better filters display

This commit is contained in:
jeromenadaud
2013-08-01 16:59:08 +02:00
parent 047ab9d681
commit a29fa2dd09
2 changed files with 15 additions and 12 deletions
@@ -77,6 +77,7 @@
<fieldset class="col-lg-12"> <fieldset class="col-lg-12">
{block name="override_header"}{/block} {block name="override_header"}{/block}
{if $show_filters}
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/> <input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
<span class="pull-right"> <span class="pull-right">
<button type="submit" name="submitReset{$table}" class="btn btn-default btn-small"> <button type="submit" name="submitReset{$table}" class="btn btn-default btn-small">
@@ -86,6 +87,7 @@
<i class="icon-filter"></i> {l s='Filter'} <i class="icon-filter"></i> {l s='Filter'}
</button> </button>
</span> </span>
{/if}
{/if} {/if}
<table <table
class="table table-hover" class="table table-hover"
@@ -131,7 +133,7 @@
<th>{l s='Actions'}{if !$simple_header}{/if}</th> <th>{l s='Actions'}{if !$simple_header}{/if}</th>
{/if} {/if}
</tr> </tr>
{if !$simple_header} {if !$simple_header && $show_filters}
<tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}"> <tr class="nodrag nodrop filter {if $row_hover}row_hover{/if}">
<td class="center"> <td class="center">
{if $has_bulk_actions} {if $has_bulk_actions}
+12 -11
View File
@@ -574,31 +574,32 @@ class HelperListCore extends Helper
$this->fields_list[$key] = $params; $this->fields_list[$key] = $params;
} }
if (count($this->_list) <= 1) $has_value = false;
foreach ($this->fields_list as $key => $field)
{ {
$simple_header = true; if (isset($field['value']) && $field['value'] !== false)
$bulk_actions = array(); {
} $has_value = true;
else break;
{ }
$simple_header = $this->simple_header;
$bulk_actions = $this->bulk_actions;
} }
Context::getContext()->smarty->assign(array( Context::getContext()->smarty->assign(array(
'page' => $page, 'page' => $page,
'simple_header' => $simple_header, 'simple_header' => $this->simple_header,
'total_pages' => $total_pages, 'total_pages' => $total_pages,
'selected_pagination' => $selected_pagination, 'selected_pagination' => $selected_pagination,
'pagination' => $this->_pagination, 'pagination' => $this->_pagination,
'list_total' => $this->listTotal, 'list_total' => $this->listTotal,
'token' => $this->token, 'token' => $this->token,
'table' => $this->table, 'table' => $this->table,
'bulk_actions' => $bulk_actions 'bulk_actions' => (count($this->_list) <= 1 && !$has_value) ? array() : $this->bulk_actions
)); ));
$this->header_tpl->assign(array_merge($this->tpl_vars, array( $this->header_tpl->assign(array_merge($this->tpl_vars, array(
'title' => $this->title, 'title' => $this->title,
'show_filters' => (count($this->_list) <= 1 && !$has_value) ? false : true,
'show_toolbar' => $this->show_toolbar, 'show_toolbar' => $this->show_toolbar,
'toolbar_scroll' => $this->toolbar_scroll, 'toolbar_scroll' => $this->toolbar_scroll,
'toolbar_btn' => $this->toolbar_btn, 'toolbar_btn' => $this->toolbar_btn,
@@ -613,7 +614,7 @@ class HelperListCore extends Helper
'id_cat' => $id_cat, 'id_cat' => $id_cat,
'shop_link_type' => $this->shopLinkType, 'shop_link_type' => $this->shopLinkType,
'has_actions' => !empty($this->actions), 'has_actions' => !empty($this->actions),
'has_bulk_actions' => !empty($bulk_actions), 'has_bulk_actions' => (count($this->_list) <= 1 && !$has_value) ? false : !empty($this->bulk_actions),
'table_id' => isset($table_id) ? $table_id : null, 'table_id' => isset($table_id) ? $table_id : null,
'table_dnd' => isset($table_dnd) ? $table_dnd : null, 'table_dnd' => isset($table_dnd) ? $table_dnd : null,
'name' => isset($name) ? $name : null, 'name' => isset($name) ? $name : null,