{% extends '@EasyAdmin/crud/index.html.twig' %}
{% block table_body %}
{% for entity in entities %}
{% if not entity.isAccessible %}
{% set some_results_are_hidden = true %}
{% else %}
<tr data-id="{{ entity.primaryKeyValueAsString }}">
{% if has_batch_actions %}
<td><input type="checkbox" class="form-batch-checkbox" value="{{ entity.primaryKeyValue }}"></td>
{% endif %}
{% for field in entity.fields %}
<td class="{{ field.property == sort_field_name ? 'sorted' }} text-{{ field.textAlign }} {{ field.cssClass }}" dir="{{ ea.i18n.textDirection }}">
{% if field.property == 'tipoEntidad' %}
{% if field.value == 0 %}
Preinscrito
{% else %}
{{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }}
{% endif %}
{% elseif field.property == 'activo' %}
{% if field.value is null %}
Nuevo
{% elseif field.value == false %}
No vigente
{% else %}
Vigente
{% endif %}
{% else %}
{{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }}
{% endif %}
</td>
{% endfor %}
{% block entity_actions %}
<td class="actions">
{% if not ea.crud.showEntityActionsAsDropdown %}
{% for action in entity.actions %}
{{ include(action.templatePath, { action: action, entity: entity, isIncludedInDropdown: ea.crud.showEntityActionsAsDropdown }, with_context = false) }}
{% endfor %}
{% else %}
<div class="dropdown dropdown-actions">
<a class="dropdown-toggle btn btn-secondary btn-sm" href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-fw fa-ellipsis-h"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
{% for action in entity.actions %}
{{ include(action.templatePath, { action: action, isIncludedInDropdown: ea.crud.showEntityActionsAsDropdown }, with_context = false) }}
{% endfor %}
</div>
</div>
{% endif %}
</td>
{% endblock entity_actions %}
</tr>
{% endif %}
{% else %}
<tr>
<td class="no-results" colspan="100">
{{ 'datagrid.no_results'|trans(ea.i18n.translationParameters, 'EasyAdminBundle') }}
</td>
</tr>
{% endfor %}
{% if some_results_are_hidden %}
<tr class="datagrid-row-empty">
<td class="text-center" colspan="{{ entities|first.fields|length + 1 }}">
<span class="datagrid-row-empty-message"><i class="fa fa-lock mr-1"></i> {{ 'datagrid.hidden_results'|trans({}, 'EasyAdminBundle') }}</span>
</td>
</tr>
{% endif %}
{% endblock %}