templates/admin/fields/attachments.html.twig line 1

Open in your IDE?
  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var field \EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto #}
  3. {# @var entity \EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto #}
  4. {#<script>console.log({{_context | json_encode | raw}})</script>#}
  5. {% set parentEntity = entity.fqcn %}
  6. {% set tab = 'bestanden' %}
  7. {% set maxTextLength = 25 %}
  8. {% set urlSubControllerNew =
  9.     ea_url()
  10.     .setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
  11.     .setAction('new')
  12.     .unSet('entityId')
  13.     .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  14.     .set('parentEntity', ea.getCrud().entityFqcn)
  15.     .set('parentId', entity.instance.id)
  16.     .set('tab', tab)
  17. %}
  18.     {% if ea.crud.currentAction == 'detail' %}
  19.         <table class="table datagrid"> <tr>
  20.             {#<th>
  21.                     <div class="form-check">
  22.                         <span>
  23.                             <input type="checkbox" class="form-check-input form-batch-checkbox-all" id="form-batch-checkbox-all" >
  24.                         </span>
  25.                     </div>
  26.                     </th>#}
  27.             <th>Naam</th>
  28.             <th>Bestandsoort</th>
  29.             <th>Uitgelicht</th>
  30.             <th>Gewijzigd op</th>
  31.             <th>Grootte</th>
  32.             <th></th>
  33.         </tr>
  34.         {% for value in field.value %}
  35.             {% set urlSubControllerDetail =
  36.         ea_url()
  37.             .setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
  38.             .setAction('edit')
  39.             .setEntityId(value.id)
  40.             .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  41.             .set('parentEntity', ea.getCrud().entityFqcn)
  42.             .set('parentId', entity.instance.id)
  43.             .set('tab', tab)
  44.         %}
  45.             <tr
  46.                 data_id={{ value.id }}>
  47.                 {#        <td class="batch-actions-selector">
  48.                             <div class="form-check">
  49.                                 <input type="checkbox" class="form-check-input form-batch-checkbox" id="form-batch-checkbox-0" value="{{ value.id }}" data-row-index="0">
  50.                             </div>
  51.                         </td> #}
  52.                 <td>
  53.                     <a href="/download-file/{{value.orderid.id}}/{{ value.id }}">{{ value.name }}</a>
  54.                 </td>
  55.                 <td>{{ value.bestandsoort }}</td>
  56.                 <td>
  57.                     {% if value.uitgelicht %}
  58.                         <div class='text-success fa fa-check'></div>
  59.                     {% endif %}
  60.                 </td>
  61.                 <td>{{ value.updatedAt|date('Y-m-d\\ H:i:s') }}</td>
  62.                 <td>{{ value.size }}</td>
  63.                 <td class="actions actions-as-dropdown">
  64.                     <div "dropdown dropdown-actions">
  65.                         <a class="dropdown" href="#" role="button" data-bs-toggle="dropdown" aria-haspop="true" aria-expanded="false">
  66.                             <svg xmls="http://www.w3.org/2000/svg" height="21" width="21" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  67.                                 <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>
  68.                             </svg>
  69.                         </a>
  70.                         <div class="dropdown-menu dropdown-menu-right">
  71.                             {% set urldetail = ea_url()
  72.                                 .setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
  73.                                 .setAction('detail')
  74.                                 .set('entityId' , value.id )
  75.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  76.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  77.                                 .set('parentId', entity.instance.id)
  78.                                 .set('tab', tab)
  79.                                 %}
  80.                             <a class="dropdown-item action-detail" href="{{ urldetail }}" data-action-name="detail">
  81.                                 <span class="action-label">Bekijk</span>
  82.                             </a>
  83.                             {% set urledit = ea_url()
  84.                                 .setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
  85.                                 .setAction('edit')
  86.                                 .set('entityId' , value.id )
  87.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  88.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  89.                                 .set('parentId', entity.instance.id)
  90.                                 .set('tab', tab)
  91.                                 .removeReferrer()
  92.                                 %}
  93.                             <a class="dropdown-item action-edit" href="{{ urledit }}" data-action-name="edit">
  94.                                 <span class="action-label">Bewerken</span>
  95.                             </a>
  96.                             {% set urldelete = "hoi-1" %}
  97.                             {% set formaction = ea_url()
  98.                                 .setController('App\\Controller\\Admin\\Attachment\\Sub\\AttachmentSubController')
  99.                                 .setAction('delete')
  100.                                 .set('entityId' , value.id )
  101.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  102.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  103.                                 .set('parentId', entity.instance.id)
  104.                                 .set('tab', tab)
  105.                                 .removeReferrer()
  106.                             
  107.                              %}
  108.                             {# urldelete ="http://localhost/admin?crudAction=delete&amp;crudControllerFqcn=App%5CController%5CAdmin%5CPartij%5CPartijCrudController&amp;entityId=1&amp;referrer=http://localhost/admin?crudAction%3Ddetail%26crudControllerFqcn%3DApp%255CController%255CAdmin%255CPartij%255CPartijCrudController%26entityId%3D1" #}
  109.                             {# formaction = "http://localhost/admin?crudAction=delete&amp;crudControllerFqcn=App%5CController%5CAdmin%5CPartij%5CPartijCrudController&amp;entityId=1" #}
  110.                                 <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>
  111.                             </a>
  112.                         </div>
  113.                     </div>
  114.                 </td>
  115.             </tr>
  116.         {% endfor %}
  117.     </table>
  118. {#</form>#}
  119. <br>
  120. <div class="container p-0">
  121.     <div class="d-flex flex-row-reverse justify-content-between">
  122.         <div>
  123.             <a class="action-new btn btn-primary d-inline-block" href={{ urlSubControllerNew }} &menuindex="2&submenuIndex=0">
  124.                 <span class="action-label">
  125.                     Upload nieuw bestand
  126.                 </span>
  127.             </a>
  128.         </div>
  129.         {#
  130.                 <div class="batch-actions d-none">
  131.                     <div class="dropdown dropdown-actions me-2">
  132.                         <a class="action-Kies actie btn btn-secundary dropdown-toggle show" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="true">
  133.                             <i class="action-icon fa fa-check"></i>
  134.                             <span class="action-label">Kies actie</span>
  135.                         </a>
  136.                         {% set urlAction = '#' %}
  137.                         <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">
  138.                             <div>
  139.                                 <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">
  140.                                     Bestel met nieuwe bestelling
  141.                                 </a>
  142.                             </div>
  143.                             <div>
  144.                                 <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">
  145.                                     Materiaal wijzigen
  146.                                 </a>
  147.                             </div>
  148.                         </div>
  149.                     </div>
  150.                 </div>
  151.         
  152.         
  153.         </div>
  154.         
  155.                 <div class="text-muted ms-2 mt-4">
  156.                     <i class="action-icon fa fa-arrow-up"></i>
  157.                     <i>&nbsp;Selecteer onderdelen voor actie</i>
  158.                 </div>
  159.         
  160.            
  161.                 <div id="modal-batch-action" class="modal fade" tabindex="-1" style="display: none;" aria-hidden="true">
  162.                     <div class="modal-dialog">
  163.                         <div class="modal-content">
  164.                             <div id="confirmation-title" class="modal-body">
  165.                                 <h4 id="batch-action-confirmation-title">Onbekende actie!!</h4>
  166.                             </div>
  167.                             <div class="modal-footer">
  168.                                 <button type="button" data-bs-dismiss="modal" class="btn btn-secondary">
  169.                                     <span class="btn-label">Annuleren</span>
  170.                                 </button>
  171.                                 <button type="button" id="modal-batch-action-button" data-bs-dismiss="modal" class="btn btn-danger">
  172.                                     <i class="fa fa-fw fa-check"></i>
  173.                                     <span class="btn-label">Verdergaan</span>
  174.                                 </button>
  175.                             </div>
  176.                         </div>
  177.                     </div>
  178.                 </div>
  179.         #}
  180.         </div>
  181.         </div>
  182.         {#
  183.                 <script>
  184.                 function setModalMelding2(actie) {
  185.                     var element = document.getElementById("confirmation-title");
  186.                     
  187.                 
  188.                     switch (actie) {
  189.                     case 'materiaal': 
  190.                         element.innerHTML = '<h4 id="batch-action-confirmation-title">Wilt u het materiaal wijzigen van de geselecteerde onderdelen?</h4>';
  191.                         break;
  192.                     case 'bestellen': 
  193.                         element.innerHTML = '<h4 id="batch-action-confirmation-title">Wilt u een nieuwe bestelling maken met de geselecteerde onderdelen?</h4>';
  194.                         break;
  195.                     default: 
  196.                         element.innerHTML = '<h4 id="batch-action-confirmation-title">Onbekende actie!!</h4>';
  197.                     }
  198.                 }
  199.                 </script>
  200.                  #}
  201.     {% else %}
  202.         <span class="badge badge-secondary">{{ field.formattedValue }}</span>
  203.     {% endif %}