diff options
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/index.twig')
-rw-r--r-- | fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/index.twig | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/index.twig b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/index.twig index 074a30b..15bfe45 100644 --- a/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/index.twig +++ b/fai_gestion/plugins/CustomTheme/src/Template/Bake/Template/index.twig @@ -39,6 +39,9 @@ * @var \{{ namespace }}\View\AppView $this * @var \{{ entityClass }}[]|\Cake\Collection\CollectionInterface ${{ pluralVar }} */ + +// index could contain table head filters and labels in <th> aren't useful +$this->Form->setTemplates(['label' => '']); ?> {% set fields = Bake.filterFields(fields, schema, modelObject, indexColumns, ['binary', 'text']) %} <nav class="large-3 medium-4 columns" id="actions-sidebar"> @@ -61,6 +64,31 @@ <h3><?= __('{{ pluralHumanName }}') ?></h3> <table cellpadding="0" cellspacing="0"> <thead> +{% if BakeExtra.hasFilters(modelClass) %} + <tr class="filter"> + <?= $this->Form->create(null, ['valueSources' => 'query']) . "\n"; ?> +{% for k, filter in BakeExtra.getFilters(modelClass) %} + <th colspan="{{ filter.colspan }}"> + <?= $this->Form->control('{{ k }}', [ + 'placeholder' => __('{{ filter.hint }}'), + 'empty' => __('{{ filter.hint }}') + ]) . "\n"; ?> + </th> +{% endfor %} + <th class="actions"> + <?php + echo $this->Form->button('Filter', [ 'type' => 'submit' ]); + if (!empty($_isSearch)) { + echo " " . $this->Html->link('Reset', [ 'action' => 'index' ]); + } + echo "\n"; + ?> + </th> +{% if BakeExtra.hasFilters(modelClass) %} + <?= $this->Form->end() . "\n"; ?> +{% endif %} + </tr> +{% endif %} <tr> {% for field in fields %} <th scope="col"><?= $this->Paginator->sort('{{ field }}') ?></th> |