templates/admin/fields/reminders.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. {% set tab = 'reminders' %}
  5.     {% if ea.crud.currentAction == 'detail' %}
  6.         <table class="table datagrid"> <tr>
  7.             <th>Datum</th>
  8.             <th>Titel</th>
  9.             <th>Opmerking</th>
  10.             <th>Actief</th>
  11.             <th></th>
  12.         </tr>
  13.         {% for value in field.value %}
  14.             {% if (value.isActive or not value.isActive ) %}
  15.                 <tr data_id="{{ value.id}}">
  16.                     <td>{{ value.datum|date('d-m-Y') }}</td>
  17.                     <td>{{ value.titel }}</td>
  18.                     <td>{{ value.opmerking|length > 200 ? value.opmerking|slice(0, 200) ~'.....' : value.opmerking }}</td>
  19.                     <td>
  20.                         {% if (value.isActive) %}
  21.                             Ja
  22.                         {% else %}
  23.                             Nee
  24.                         {% endif %}
  25.                     </td>
  26.                     <td class="actions actions-as-dropdown">
  27.                         <div class="dropdown dropdown-actions">
  28.                             <a class="dropdown" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  29.                                 <svg xmlns="http://www.w3.org/2000/svg" height="21" width="21" fill="none" viewbox="0 0 24 24" stroke="currentColor">
  30.                                     <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>
  31.                                 </svg>
  32.                             </a>
  33.                             <div class="dropdown-menu dropdown-menu-right">
  34.                                 {% set urldetail = ea_url()
  35.                                 .setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
  36.                                 .setAction('detail')
  37.                                 .set('entityId' , value.id )
  38.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  39.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  40.                                 .set('parentId', entity.instance.id)
  41.                                 .set('tab', tab)
  42.                                 %}
  43.                                 <a class="dropdown-item action-detail" href="{{ urldetail }}" data-action-name="detail">
  44.                                     <span class="action-label">Bekijk</span>
  45.                                 </a>
  46.                                 {% set urledit = ea_url()
  47.                                 .setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
  48.                                 .setAction('edit')
  49.                                 .set('entityId' , value.id )
  50.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  51.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  52.                                 .set('parentId', entity.instance.id)
  53.                                 .set('tab', tab)
  54.                                 .removeReferrer()
  55.                                 %}
  56.                                 <a class="dropdown-item action-edit" href="{{ urledit }}" data-action-name="edit">
  57.                                     <span class="action-label">Bewerken</span>
  58.                                 </a>
  59.                                 {% set urldeletereminder = ea_url()
  60.                                 .setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
  61.                                 .setAction('deleteReminder')
  62.                                 .set('entityId', value.id)
  63.                                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  64.                                 .set('parentEntity', ea.getCrud().entityFqcn)
  65.                                 .set('parentId', entity.instance.id)
  66.                                 .set('reminderId', value.id)
  67.                                 .set('tab', tab)
  68.                                 .removeReferrer()
  69.                                 %}
  70.                                 {#   <a class="dropdown-item  text-danger" href="{{ urldeletereminder }}" >
  71.                                                                 <span class="action-label">Verwijderen</span>
  72.                                                             </a> #}
  73.                             </div>
  74.                         </div>
  75.                     </td>
  76.                 </tr>
  77.             {% endif %}
  78.         {% endfor %}
  79.     </table>
  80.     {% set url = ea_url()
  81.                 .setController('App\\Controller\\Admin\\Reminder\\Sub\\ReminderSubController')
  82.                 .setAction('new')
  83.                 .unset('entityId')
  84.                 .set('parentControllerFqcn', ea.getCrud().controllerFqcn)
  85.                 .set('parentEntity', ea.getCrud().entityFqcn)
  86.                 .set('parentId', entity.instance.id)
  87.                 .set('tab', tab)
  88.                 .removeReferrer()
  89.               
  90.                 %}
  91.     <br>
  92.     <div>
  93.         <p class="text-end">
  94.             <a class="action-new btn btn-primary" href="{{ url }}&menuIndex=2&submenuIndex=0">
  95.                 <span class="action-label">Maak nieuwe reminder</span>
  96.             </a>
  97.         </p>
  98.     </div>
  99. {% else %}
  100.     <span class="badge badge-secondary">{{ field.formattedValue }}</span>
  101. {% endif %}