{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
{# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
{# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
{#<script>console.log({{_context | json_encode | raw}})</script>#}
{% set parentEntity = entity.fqcn %}
{% set tab = 'bestanden' %}
{% set maxTextLength = 25 %}
{% set urlSubControllerNew =
ea_url()
.setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
.setAction('new')
.unSet('entityId')
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('tab', tab)
%}
{% if ea.crud.currentAction == 'detail' %}
<table class="table datagrid"> <tr>
{#<th>
<div class="form-check">
<span>
<input type="checkbox" class="form-check-input form-batch-checkbox-all" id="form-batch-checkbox-all" >
</span>
</div>
</th>#}
<th>Naam</th>
<th>Bestandsoort</th>
<th>Uitgelicht</th>
<th>Gewijzigd op</th>
<th>Grootte</th>
<th></th>
</tr>
{% for value in field.value %}
{% set urlSubControllerDetail =
ea_url()
.setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
.setAction('edit')
.setEntityId(value.id)
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('tab', tab)
%}
<tr
data_id={{ value.id }}>
{# <td class="batch-actions-selector">
<div class="form-check">
<input type="checkbox" class="form-check-input form-batch-checkbox" id="form-batch-checkbox-0" value="{{ value.id }}" data-row-index="0">
</div>
</td> #}
<td>
<a href="/download-file/{{value.orderid.id}}/{{ value.id }}">{{ value.name }}</a>
</td>
<td>{{ value.bestandsoort }}</td>
<td>
{% if value.uitgelicht %}
<div class='text-success fa fa-check'></div>
{% endif %}
</td>
<td>{{ value.updatedAt|date('Y-m-d\\ H:i:s') }}</td>
<td>{{ value.size }}</td>
<td class="actions actions-as-dropdown">
<div "dropdown dropdown-actions">
<a class="dropdown" href="#" role="button" data-bs-toggle="dropdown" aria-haspop="true" aria-expanded="false">
<svg xmls="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\\Attachment\\Sub\\AttachmentSubController')
.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\\Attachment\\Sub\\AttachmentSubController')
.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 urldelete = "hoi-1" %}
{% set formaction = ea_url()
.setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
.setAction('delete')
.set('entityId' , value.id )
.set('parentControllerFqcn', ea.getCrud().controllerFqcn)
.set('parentEntity', ea.getCrud().entityFqcn)
.set('parentId', entity.instance.id)
.set('tab', tab)
.removeReferrer()
%}
{# urldelete ="http://localhost/admin?crudAction=delete&crudControllerFqcn=App%5CController%5CAdmin%5CPartij%5CPartijCrudController&entityId=1&referrer=http://localhost/admin?crudAction%3Ddetail%26crudControllerFqcn%3DApp%255CController%255CAdmin%255CPartij%255CPartijCrudController%26entityId%3D1" #}
{# formaction = "http://localhost/admin?crudAction=delete&crudControllerFqcn=App%5CController%5CAdmin%5CPartij%5CPartijCrudController&entityId=1" #}
<a</i class=" dropdown-item action-delete pr-0 text-danger" href="{{ urldelete }}" data-action-name="delete" formaction="{{ formaction }}" data-bs-toggle="modal" data-bs-target="#modal-delete" <i class="action-icon fa fa-fw fa-trash-o"><span class="action-label">Verwijderen</span>
</a>
</div>
</div>
</td>
</tr>
{% endfor %}
</table>
{#</form>#}
<br>
<div class="container p-0">
<div class="d-flex flex-row-reverse justify-content-between">
<div>
<a class="action-new btn btn-primary d-inline-block" href={{ urlSubControllerNew }} &menuindex="2&submenuIndex=0">
<span class="action-label">
Upload nieuw bestand
</span>
</a>
</div>
{#
<div class="batch-actions d-none">
<div class="dropdown dropdown-actions me-2">
<a class="action-Kies actie btn btn-secundary dropdown-toggle show" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="true">
<i class="action-icon fa fa-check"></i>
<span class="action-label">Kies actie</span>
</a>
{% set urlAction = '#' %}
<div class="dropdown-menu dropdown-menu-right" style="position: absolute; inset: 0px auto auto 0px; margin: 0px; transform: translate(0px, 61px);" data-popper-placement="bottom-start">
<div>
<a id="bestellen" onclick="setModalMelding('bestellen')" class="action-bestellenOnderdelen dropdown-item" href="#" data-action-name="bestellenOnderdelen" data-bs-toggle="modal" data-bs-target="#modal-batch-action" data-action-csrf-token="en een token" data-action-batch="true" data-entity-fqcn="App\Entity\Onderdeel" data-action-url=" {{ urlAction }} " disabled="disabled">
Bestel met nieuwe bestelling
</a>
</div>
<div>
<a id="materiaal" onclick="setModalMelding('materiaal')" class="action-materiaalWijzigen dropdown-item" href="#" data-action-name="materiaalWijzigen" data-bs-toggle="modal" data-bs-target="#modal-batch-action" data-action-csrf-token="en een token" data-action-batch="true" data-entity-fqcn="App\Entity\Onderdeel" data-action-url=" {{ urlAction }} " disabled="disabled">
Materiaal wijzigen
</a>
</div>
</div>
</div>
</div>
</div>
<div class="text-muted ms-2 mt-4">
<i class="action-icon fa fa-arrow-up"></i>
<i> Selecteer onderdelen voor actie</i>
</div>
<div id="modal-batch-action" class="modal fade" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div id="confirmation-title" class="modal-body">
<h4 id="batch-action-confirmation-title">Onbekende actie!!</h4>
</div>
<div class="modal-footer">
<button type="button" data-bs-dismiss="modal" class="btn btn-secondary">
<span class="btn-label">Annuleren</span>
</button>
<button type="button" id="modal-batch-action-button" data-bs-dismiss="modal" class="btn btn-danger">
<i class="fa fa-fw fa-check"></i>
<span class="btn-label">Verdergaan</span>
</button>
</div>
</div>
</div>
</div>
#}
</div>
</div>
{#
<script>
function setModalMelding2(actie) {
var element = document.getElementById("confirmation-title");
switch (actie) {
case 'materiaal':
element.innerHTML = '<h4 id="batch-action-confirmation-title">Wilt u het materiaal wijzigen van de geselecteerde onderdelen?</h4>';
break;
case 'bestellen':
element.innerHTML = '<h4 id="batch-action-confirmation-title">Wilt u een nieuwe bestelling maken met de geselecteerde onderdelen?</h4>';
break;
default:
element.innerHTML = '<h4 id="batch-action-confirmation-title">Onbekende actie!!</h4>';
}
}
</script>
#}
{% else %}
<span class="badge badge-secondary">{{ field.formattedValue }}</span>
{% endif %}