Browse Source

Merge pull request #2474 from PHDA/checkbox_media_tree

Disable unused checkbox in media tree view when no batch and no export
Thomas 10 years ago
parent
commit
d1402c547c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Resources/views/CRUD/list_outer_rows_mosaic.html.twig

+ 5 - 1
Resources/views/CRUD/list_outer_rows_mosaic.html.twig

@@ -51,7 +51,11 @@ This template can be customized to match your needs. You should only extends the
                             </div>
                         </div>
                         <div class="mosaic-inner-text">
-                            <input type="checkbox" name="idx[]" value="{{ admin.id(object) }}">
+                            {% if (admin.hasRoute('batch') and batchactions|length > 0) or (admin.hasRoute('export') and admin.isGranted("EXPORT") and admin.getExportFormats()|length) %}
+                                <input type="checkbox" name="idx[]" value="{{ admin.id(object) }}">
+                            {% else %}
+                                &nbsp;
+                            {% endif %}
 
                             {% block sonata_mosaic_description %}
                                 {% if admin.isGranted('EDIT', object) and admin.hasRoute('edit') %}