diff --git a/Resources/views/Admin/base_list_field.html.twig b/Resources/views/Admin/base_list_field.html.twig
index 0b69115..bab750e 100755
--- a/Resources/views/Admin/base_list_field.html.twig
+++ b/Resources/views/Admin/base_list_field.html.twig
@@ -9,12 +9,12 @@ file that was distributed with this source code.
#}
-|
+ |
{% set route = field_description.options.route.name|default(null) %}
{% set action = route == 'show' ? 'VIEW' : route|upper %}
{% set spaces = "" %}
- {% if object.getLvl() is defined and object.getLvl > 0%}
+ {% if object.getLvl() is defined and object.getLvl > 0 and field_description.name != 'icon' %}
{% set level = object.getLvl() %}
{% for i in 1..level %}
@@ -28,22 +28,60 @@ file that was distributed with this source code.
and route
and action
and admin.hasRoute(route)
- and admin.isGranted(action, action in ['VIEW', 'EDIT'] ? object : null)
+ and admin.hasAccess(route, route in ['show', 'edit'] ? object : null)
%}
- {%- block field %}{{ value }}{% endblock -%}
+ {%- block field %}
+ {% spaceless %}
+ {% if field_description.options.collapse is defined %}
+ {% set collapse = field_description.options.collapse %}
+ {{ value }}
+ {% else %}
+ {{ value }}
+ {% endif %}
+ {% endspaceless %}
+ {% endblock -%}
{% else %}
- {% set isEditable = field_description.options.editable is defined and field_description.options.editable and admin.isGranted('EDIT', object) %}
+ {% set isEditable = field_description.options.editable is defined and field_description.options.editable and admin.hasAccess('edit', object) %}
{% set xEditableType = field_description.type|sonata_xeditable_type %}
{% if isEditable and xEditableType %}
- {% set url = path('sonata_admin_set_object_field_value', { 'context': 'list', 'field': field_description.name, 'objectId': admin.id(object), 'code': admin.code(object) }) %}
-
+ {% set url = path(
+ 'sonata_admin_set_object_field_value',
+ admin.getPersistentParameters|default([])|merge({
+ 'context': 'list',
+ 'field': field_description.name,
+ 'objectId': admin.id(object),
+ 'code': admin.code(object)
+ })
+ ) %}
+
+ {% if field_description.type == 'date' and value is not empty %}
+ {% set data_value = value.format('Y-m-d') %}
+ {% elseif field_description.type == 'boolean' and value is empty %}
+ {% set data_value = 0 %}
+ {% else %}
+ {% set data_value = value %}
+ {% endif %}
+
+
{{ block('field') }}
{% else %}
- {{ block('field') }}
+ {% if field_description.name == 'icon' %}
+
+ {% else %}
+ {{ block('field') }}
+ {% endif %}
{% endif %}
{% endif %}
|
diff --git a/Resources/views/Admin/list__action_activate.html.twig b/Resources/views/Admin/list__action_activate.html.twig
index fa4ce90..ea49648 100644
--- a/Resources/views/Admin/list__action_activate.html.twig
+++ b/Resources/views/Admin/list__action_activate.html.twig
@@ -1,4 +1,4 @@
-{% if admin.isGranted('EDIT', object) and admin.hasRoute('activate') %}
+{% if admin.hasAccess('edit', object) and admin.hasRoute('activate') %}
{% if object.active %}
{% set action = 'action_inactivate' %}
{% set icon = 'fa-circle-o' %}
diff --git a/Resources/views/Admin/list__action_sort.html.twig b/Resources/views/Admin/list__action_sort.html.twig
index 1840e80..9bff170 100644
--- a/Resources/views/Admin/list__action_sort.html.twig
+++ b/Resources/views/Admin/list__action_sort.html.twig
@@ -1,4 +1,4 @@
-{% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}
+{% if admin.hasAccess('edit', object) and admin.hasRoute('edit') %}
{% set parent = 0 %}
{% if object.getParent() is defined and object.getParent() is not null %}