Next major version 2 with PHP 8.1, Symfony 6, Tabler UI, 2FA ... (#2902)
This commit is contained in:
49
templates/datatable.html.twig
Normal file
49
templates/datatable.html.twig
Normal file
@@ -0,0 +1,49 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
{% import "macros/widgets.html.twig" as widgets %}
|
||||
{% import "macros/datatables.html.twig" as tables %}
|
||||
|
||||
{% block main_before %}
|
||||
{{ tables.configuration(dataTable) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block table_actions %}
|
||||
{{ tables.actions(dataTable) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block status %}
|
||||
{% if dataTable.getPagination() is not null %}
|
||||
{% from "macros/status.html.twig" import status_count %}
|
||||
{{ status_count(dataTable.getPagination().getNbResults()) }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
|
||||
{% if not dataTable.hasResults() %}
|
||||
{{ widgets.nothing_found(dataTable.getReloadEvents()) }}
|
||||
{% else %}
|
||||
{{ tables.header(dataTable) }}
|
||||
|
||||
{% block datatable_before %}{% endblock %}
|
||||
|
||||
{% set sortedColumns = dataTable.sortedColumnNames %}
|
||||
{% for entry in dataTable %}
|
||||
{% block datatable_row %}
|
||||
<tr{% block datatable_row_attr %}{% endblock %}>
|
||||
{% for column, data in sortedColumns %}
|
||||
{% block datatable_column %}
|
||||
<td class="{{ tables.class(dataTable, column) }}"{% block datatable_column_attr %}{% endblock %}>
|
||||
{% block datatable_column_value %}{% endblock %}
|
||||
</td>
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endblock %}
|
||||
{% endfor %}
|
||||
|
||||
{% block datatable_after %}{% endblock %}
|
||||
|
||||
{{ tables.footer(dataTable) }}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user