Browse Source

Change the block name to `field` (as list templates)

Thomas Rabaix 13 years ago
parent
commit
da9df1c336

+ 1 - 1
Resources/views/CRUD/base_show_field.html.twig

@@ -10,4 +10,4 @@ file that was distributed with this source code.
 #}
 
 <th>{% block name %}{{ field_description.name }}{% endblock %}</th>
-<td>{% block value %}{{ value }}{% endblock %}</td>
+<td>{% block field %}{{ value }}{% endblock %}</td>

+ 18 - 0
Resources/views/CRUD/show_array.html.twig

@@ -0,0 +1,18 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
+{% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
+
+{% block field%}
+    {% for key, val in value %}
+        [{{ key }} => {{ val }}]
+    {% endfor %}
+{% endblock %}

+ 22 - 0
Resources/views/CRUD/show_boolean.html.twig

@@ -0,0 +1,22 @@
+{#
+
+This file is part of the Sonata package.
+
+(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
+
+For the full copyright and license information, please view the LICENSE
+file that was distributed with this source code.
+
+#}
+
+{% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
+
+{% block field %}
+{% spaceless %}
+    {% if value %}
+        <img src="{{ asset('bundles/sonataadmin/famfamfam/accept.png') }}" alt="{%- trans from 'SonataAdminBundle' %}label_type_yes{% endtrans -%}" />
+    {% else %}
+        <img src="{{ asset('bundles/sonataadmin/famfamfam/exclamation.png') }}" alt="{%- trans from 'SonataAdminBundle' %}label_type_no{% endtrans -%}" />
+    {% endif %}
+{% endspaceless %}
+{% endblock %}

+ 1 - 1
Resources/views/CRUD/show_date.html.twig

@@ -11,4 +11,4 @@ file that was distributed with this source code.
 
 {% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
 
-{% block value %}{{ value|date('F j, Y') }}{% endblock %}
+{% block field %}{{ value|date('F j, Y') }}{% endblock %}

+ 1 - 1
Resources/views/CRUD/show_datetime.html.twig

@@ -11,5 +11,5 @@ file that was distributed with this source code.
 
 {% extends 'SonataAdminBundle:CRUD:base_show_field.html.twig' %}
 
-{% block value %}{{ value|date }}{% endblock %}
+{% block field %}{{ value|date }}{% endblock %}