src/Products/NotificationsBundle/Resources/views/dashboard/lists/includes/_results.html.twig line 22

Open in your IDE?
  1. {% set headers = _args.headers|default([
  2.     {
  3.         title: 'Name',
  4.         sort: constant('SORTS__NAME', search),
  5.     },
  6.     {
  7.         title: 'Contacts',
  8.         spacing: 10,
  9.     },
  10.     {
  11.         title: 'Type',
  12.         spacing: 10,
  13.         sort: constant('SORTS__TYPE', search),
  14.     },
  15.     {
  16.         title: 'Last Modified',
  17.         spacing: 15,
  18.         sort: constant('SORTS__TIMESTAMP', search),
  19.     },
  20. ]) %}
  21. {% embed '@ui2022/table--search.html.twig' with {
  22.     form: form,
  23.     headers: headers,
  24.     pagination: pagination|default(null),
  25. } %}
  26.     {% block items %}
  27.         {% if lists is empty %}
  28.             {% include '@ui2022/table__empty.html.twig' with {
  29.                 title: 'No lists found',
  30.                 message: 'No lists matching the criteria were found in the system.'
  31.             } %}
  32.         {% else %}
  33.             {% for list in lists %}
  34.                 {% set isGranted = is_granted('app.notifications.lists.admin', list) %}
  35.                 <tr>
  36.                     {% include '@ui2022/table__item__cell--status.html.twig' with {
  37.                         title: list.name,
  38.                         link: isGranted ? path('app.notifications.dashboard.lists.view', {
  39.                             list: list.id,
  40.                         }) : null,
  41.                         subtext: 'by %s'|format(
  42.                             list.touchedBy ? list.touchedBy.displayName : 'SYSTEM'
  43.                         ),
  44.                         actions: (isGranted and not list.fixed) ? [
  45.                             {
  46.                                 text: 'Edit',
  47.                                 link: path('app.notifications.dashboard.lists.update', {
  48.                                     list: list.id,
  49.                                 }),
  50.                             },
  51.                             {
  52.                                 text: 'More',
  53.                                 dropdown: {
  54.                                     items: [
  55.                                         {
  56.                                             text: 'Delete',
  57.                                             link: path('app.notifications.dashboard.lists.delete', {
  58.                                                 list: list.id,
  59.                                             }),
  60.                                             modal: 'modal__result_delete',
  61.                                         },
  62.                                     ],
  63.                                 },
  64.                             },
  65.                         ] : [],
  66.                     } %}
  67.                     <td>
  68.                         {% if isGranted %}<a href="{{- path('app.notifications.dashboard.lists.view', {
  69.                             list: list.id,
  70.                         }) -}}">{% endif %}
  71.                             {{- (list.count is not null) ? list.count|number_format : '—' -}}
  72.                         {% if isGranted %}</a>{% endif %}
  73.                     </td>
  74.                     <td>
  75.                         {% if list.discr == 'condition' %}
  76.                             {{ list.typeNames|map(t => 'app.oneroster.enums.role_type.%s'|format(t)|trans)|join(', ') }}
  77.                         {% else %}
  78.                             {{- 'app.notifications.lists.types.%s'|format(list.discr)|trans -}}
  79.                         {% endif %}
  80.                     </td>
  81.                     <td>
  82.                         {{- list.timestampedAt|ui_relativeDate -}}
  83.                     </td>
  84.                 </tr>
  85.             {% endfor %}
  86.         {% endif %}
  87.     {% endblock %}
  88. {% endembed %}