chill-bundles/Resources/views/CRUD/_index.html.twig

49 lines
1.3 KiB
Twig

<div class="grid-10 centered">
{% block index_header %}
<h1>{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}</h1>
{% endblock index_header %}
{% if entities|length == 0 %}
{% block no_existing_entities %}
<p>{{ no_existing_entities_sentences|default('No entities')|trans }}</p>
{% endblock %}
{% else %}
{% block table_entities %}
<table>
<thead>
<tr>
{% block table_entities_thead_tr %}
<th>id</th>
{% endblock %}
</tr>
</thead>
<tbody>
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
</tr>
{% endfor %}
{% endblock %}
</tbody>
</table>
{% endblock %}
{% endif %}
<div class="crud_index__pagination">
{{ chill_pagination(paginator) }}
</div>
{% block list_actions %}
<ul class="record_actions sticky-form-buttons">
{% block add_new %}
<li>
<a href="{{ chill_path_add_return_path('chill_crud_' ~ crud_name ~ '_new') }}" class="sc-button bt-new">{{ ('crud.'~crud_name~'.index.add_new')|trans( {'%crud_name%': crud_name} ) }}</a>
</li>
{% endblock %}
</ul>
{% endblock list_actions %}
</div>