瀏覽代碼

Merge pull request #570 from EmmanuelVella/list-footer

Added page number/results counts in list footer
Thomas 13 年之前
父節點
當前提交
fb71ac6ed2

+ 5 - 0
Resources/translations/SonataAdminBundle.en.xliff

@@ -301,6 +301,11 @@
                 <target>View Revision</target>
             </trans-unit>
 
+            <trans-unit id="list_results_count">
+                <source>list_results_count</source>
+                <target>{1}1 result|]1,Inf] %count% results</target>
+            </trans-unit>
+
         </body>
     </file>
 </xliff>

+ 5 - 1
Resources/translations/SonataAdminBundle.fr.xliff

@@ -259,6 +259,10 @@
                 <target>Afficher la révision</target>
             </trans-unit>
 
+            <trans-unit id="list_results_count">
+                <source>list_results_count</source>
+                <target>{1}1 résultat|]1,Inf] %count% résultats</target>
+            </trans-unit>
         </body>
     </file>
-</xliff>
+</xliff>

+ 9 - 0
Resources/views/CRUD/base_list.html.twig

@@ -72,6 +72,15 @@ file that was distributed with this source code.
                 {% endblock %}
 
                 {% block table_footer %}
+                    <tr>
+                        <th colspan="{{ admin.list.elements|length - 1 }}">
+                            {{ admin.datagrid.pager.page }} / {{ admin.datagrid.pager.lastpage }}
+                        </th>
+                        <th>
+                            {% transchoice admin.datagrid.pager.nbresults with {'%count%': admin.datagrid.pager.nbresults} from 'SonataAdminBundle' %}list_results_count{% endtranschoice %}
+                        </th>
+                    </tr>
+
                     {% if admin.datagrid.pager.haveToPaginate() %}
                         <tr>
                             <td colspan="{{ admin.list.elements|length }}" class="pager">