浏览代码

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

develop
Guillaume 3 年前
父节点
当前提交
0fe2d9f752
共有 2 个文件被更改,包括 12 次插入5 次删除
  1. +3
    -2
      ShopBundle/Controller/Backend/AdminController.php
  2. +9
    -3
      ShopBundle/Resources/views/backend/default/list.html.twig

+ 3
- 2
ShopBundle/Controller/Backend/AdminController.php 查看文件

@@ -194,8 +194,9 @@ class AdminController extends EasyAdminController
));
$this->filtersForm->handleRequest($this->request);
$easyadmin = $this->request->attributes->get('easyadmin');

if (($this->filtersForm->isSubmitted() && $this->filtersForm->isValid()) || $this->entity[$easyadmin['view']]['filters']!==false) {
$view = $easyadmin['view'];
if($easyadmin['view']=='listChildren') $view = 'list';
if (($this->filtersForm->isSubmitted() && $this->filtersForm->isValid()) || $this->entity[$view]['filters']!==false) {
foreach ($listFields as $field) {
if ($this->filtersForm->has($field['property'])) {
switch ($field['dataType']) {

+ 9
- 3
ShopBundle/Resources/views/backend/default/list.html.twig 查看文件

@@ -97,7 +97,7 @@
{% set itemsPerPage = [10,20,30,50,100,200] %}
{% for itemPerPage in itemsPerPage %}
<a href="{{ path('easyadmin', _request_parameters|merge({ maxResults: itemPerPage, page : "1" })) }}"
class="btn btn-sm {{ paginator.maxPerPage == itemPerPage ? 'btn-outline-secondary' : 'btn-secondary'}}">{{ itemPerPage }}</a>
class="btn btn-sm {{ paginator.maxPerPage == itemPerPage ? 'btn-outline-secondary' : 'btn-secondary' }}">{{ itemPerPage }}</a>
{% endfor %}

</div>
@@ -217,8 +217,14 @@
{% set _column_label = metadata.label|trans(_trans_parameters) %}
{% set _column_icon = isSortingField ? (nextSortDirection == 'DESC' ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %}
{% set isFilteredField = false %}
{% if filters_form[field] is defined and filters_form[field].vars.value is not empty %} {% set isFilteredField = false %}
{% set isFilteredField = true %}
{% if filters_form[field] is defined and filters_form[field].vars.value is not empty %}
{% if (metadata['dataType'] == 'datetime' or metadata['dataType'] == 'date') %}
{% if filters_form[field]['dateStart'].vars.value is not empty and filters_form[field]['dateEnd'].vars.value is not empty %}
{% set isFilteredField = true %}
{% endif %}
{% else %}
{% set isFilteredField = true %}
{% endif %}
{% endif %}



正在加载...
取消
保存