{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
{# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
{% set tab = 'reminders' %}
{% if ea.crud.currentAction == 'detail' %}
<table class="table datagrid"> <tr>
<th>Datum</th>
<th>Titel</th>
<th>Opmerking</th>
<th>Actief</th>
<th></th>
</tr>
{% for value in field.value %}
{% if (value.isActive or not value.isActive ) %}
<tr data_id="{{ value.id}}">
<td>{{ value.datum|date('d-m-Y') }}</td>
<td>{{ value.titel }}</td>
<td>{{ value.opmerking|length > 200 ? value.opmerking|slice(0, 200) ~'.....' : value.opmerking }}</td>
<td>
{% if (value.isActive) %}
Ja
{% else %}
Nee
{% endif %}
</td>
<td class="actions actions-as-dropdown">
<div class="dropdown dropdown-actions">
<a class="dropdown" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<svg xmlns="http://www.w3.org/2000/svg" height="21" width="21" fill="none" viewbox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z"></path>
</svg>
</a>
<div class="dropdown-menu dropdown-menu-right">
{% set urldetail = ea_url()
.setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
.setAction('detail')
.set('entityId' , value.id )
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('tab', tab)
%}
<a class="dropdown-item action-detail" href="{{ urldetail }}" data-action-name="detail">
<span class="action-label">Bekijk</span>
</a>
{% set urledit = ea_url()
.setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
.setAction('edit')
.set('entityId' , value.id )
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('tab', tab)
.removeReferrer()
%}
<a class="dropdown-item action-edit" href="{{ urledit }}" data-action-name="edit">
<span class="action-label">Bewerken</span>
</a>
{% set urldeletereminder = ea_url()
.setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
.setAction('deleteReminder')
.set('entityId', value.id)
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('reminderId', value.id)
.set('tab', tab)
.removeReferrer()
%}
{# <a class="dropdown-item text-danger" href="{{ urldeletereminder }}" >
<span class="action-label">Verwijderen</span>
</a> #}
</div>
</div>
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% set url = ea_url()
.setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
.setAction('new')
.unset('entityId')
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('tab', tab)
.removeReferrer()
%}
<br>
<div>
<p class="text-end">
<a class="action-new btn btn-primary" href="{{ url }}&menuIndex=2&submenuIndex=0">
<span class="action-label">Maak nieuwe reminder</span>
</a>
</p>
</div>
{% else %}
<span class="badge badge-secondary">{{ field.formattedValue }}</span>
{% endif %}