Kaynağa Gözat

Merge branch 'master' of https://github.com/tyx/BaseApplicationBundle into tyx-master

Thomas 14 yıl önce
ebeveyn
işleme
ab6a3b9438

+ 13 - 2
Resources/views/CRUD/base_list.twig.html

@@ -27,7 +27,11 @@ file that was distributed with this source code.
             {% block table_header %}
                 <tr>
                     {% for field_description in fields %}
-                        <th>{{ field_description.name }}</th>
+                        {% if field_description.getOption('code') == '_batch' %}
+                          <th><input type="checkbox" id="list_batch_checkbox" /></th>
+                        {% else %}
+                          <th>{{ field_description.name }}</th>
+                        {% endif %}
                     {% endfor %}
                 </tr>
             {% endblock %}
@@ -54,7 +58,7 @@ file that was distributed with this source code.
                                 {% endfor %}
 
                                 {% if datagrid.pager.page != datagrid.pager.nextpage %}
-                                    <li><a href="{{ admin.generateUrl('list', datagrid.values|merge({'page': datagrid.pager.nextpage})) }}">{% trans 'link_previous_pager' from 'BaseApplicationBundle' %}</a></li>
+                                    <li><a href="{{ admin.generateUrl('list', datagrid.values|merge({'page': datagrid.pager.nextpage})) }}">{% trans 'link_next_pager' from 'BaseApplicationBundle' %}</a></li>
                                 {% endif %}
                             </ul>
                         </td>
@@ -62,6 +66,13 @@ file that was distributed with this source code.
                 {% endif %}
             {% endblock %}
         </table>
+        <script type="text/javascript">
+            jQuery(document).ready(function($){
+               $('#list_batch_checkbox').click(function(){
+                   $(this).closest('table').find("td input[type='checkbox']").attr('checked', $(this).is(':checked'));
+               });
+            });
+        </script>
 
         <div>
             <select name="action" >

+ 3 - 5
Resources/views/CRUD/base_list_field.twig.html

@@ -11,10 +11,8 @@ file that was distributed with this source code.
 
 {% if field_description.getOption('identifier') %}
     <a href="{{ admin.generateUrl('edit', {'id': object.id}) }}">
-{% endif %}
-
-{% block field%}{{ value }}{% endblock %}
-
-{% if field_description.getOption('identifier') %}
+        {% block field %}{{ value }}{% endblock %}
     </a>
+{% else %}
+    {{ block('field') }}
 {% endif %}

+ 2 - 1
Resources/views/CRUD/list_mediumint.twig.html

@@ -8,4 +8,5 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataBaseApplicationBundle:CRUD:list_integer.twig.html' %}
+
+{% extends 'SonataBaseApplicationBundle:CRUD:edit_integer.twig.html' %}

+ 2 - 1
Resources/views/CRUD/list_tinyint.twig.html

@@ -8,4 +8,5 @@ For the full copyright and license information, please view the LICENSE
 file that was distributed with this source code.
 
 #}
-{% extends 'SonataBaseApplicationBundle:CRUD:list_integer.twig.html' %}
+
+{% extends 'SonataBaseApplicationBundle:CRUD:edit_integer.twig.html' %}