src/Products/NotificationsBundle/Resources/views/dashboard/profiles/includes/_results.html.twig line 1

Open in your IDE?
  1. {% set minimal = _args.minimal|default(false) %}
  2. {% set pagination_target = _args.pagination_target|default(null) %}
  3. {% if minimal %}
  4.     {% set headers = _args.headers|default([
  5.         {
  6.             title: 'Name',
  7.             sort: constant('SORTS__LAST_NAME', search),
  8.         },
  9.     ]) %}
  10. {% else %}
  11.     {% set headers = _args.headers|default([
  12.         {
  13.             title: 'Last Name',
  14.             spacing: 25,
  15.             sort: constant('SORTS__LAST_NAME', search),
  16.         },
  17.         {
  18.             title: 'First Name',
  19.             sort: constant('SORTS__FIRST_NAME', search),
  20.         },
  21.     ]) %}
  22. {% endif %}
  23. {% if additionalTitles is defined %}
  24.     {% for additionalTitle in additionalTitles %}
  25.         {% set headers = headers|merge([
  26.             {
  27.                 headerTitle: additionalTitle.categoryName,
  28.                 title: additionalTitle.name,
  29.             },
  30.         ]) %}
  31.     {% endfor %}
  32. {% endif %}
  33. {% set headers = headers|merge([
  34.     {
  35.         title: 'Type',
  36.         spacing: 10,
  37.         sort: constant('SORTS__TYPE', search),
  38.     },
  39. ]) %}
  40. {% if not minimal %}
  41.     {% set headers = headers|merge([
  42.         {
  43.             title: 'Status',
  44.             spacing: 10,
  45.             sort: constant('SORTS__STATUS', search),
  46.         },
  47.         {
  48.             title: 'Last Modified',
  49.             spacing: 10,
  50.             sort: constant('SORTS__TIMESTAMP', search),
  51.         },
  52.     ]) %}
  53. {% endif %}
  54. {% embed '@ui2022/table--search.html.twig' with {
  55.     form: form,
  56.     headers: headers,
  57.     pagination: pagination|merge({target: pagination_target})|default(null),
  58. } %}
  59.     {% block items %}
  60.         {% if profiles is empty %}
  61.             {% include '@ui2022/table__empty.html.twig' with {
  62.                 title: 'No contacts found',
  63.                 message: 'No contacts matching the criteria were found in the system.'
  64.             } %}
  65.         {% else %}
  66.             {% for profile in profiles %}
  67.                 <tr data-cs-id="{{ profile.id }}">
  68.                     {% if minimal %}
  69.                         {% include '@ui2022/table__item__cell--default.html.twig' with {
  70.                             text: profile.sortName ?: '—',
  71.                             link: path('app.notifications.dashboard.profiles.view', {
  72.                                 profile: profile.id,
  73.                             }),
  74.                             sidepanel: sidepanel,
  75.                             actions:
  76.                                 (discr is defined and discr is same as('static'))
  77.                                 ?
  78.                                 [
  79.                                     {
  80.                                         text: 'Remove',
  81.                                         link: '#',
  82.                                         attr: {
  83.                                             "data-cs-id": profile.id,
  84.                                             "class": 'btw__profile_remove'
  85.                                         },
  86.                                     },
  87.                                 ]
  88.                                 :
  89.                                 [],
  90.                         } %}
  91.                     {% else %}
  92.                         {% include '@ui2022/table__item__cell--default.html.twig' with {
  93.                             text: profile.lastName ?: '—',
  94.                             link: path('app.notifications.dashboard.profiles.view', {
  95.                                 profile: profile.id,
  96.                             }),
  97.                             sidepanel: sidepanel,
  98.                             actions: [],
  99.                         } %}
  100.                         {% include '@ui2022/table__item__cell--default.html.twig' with {
  101.                             text: profile.firstName ?: '—',
  102.                             link: path('app.notifications.dashboard.profiles.view', {
  103.                                 profile: profile.id,
  104.                             }),
  105.                             sidepanel: sidepanel,
  106.                             actions: [],
  107.                         } %}
  108.                     {% endif %}
  109.                     {% if additionalValues[profile.id] is defined %}
  110.                         {% for additionalValue in additionalValues[profile.id] %}
  111.                             <td>
  112.                                 {% if additionalValue is iterable %}
  113.                                     <ul class="list-unstyled">
  114.                                         {% for additionalValueItem in additionalValue %}
  115.                                             <li>{{ additionalValueItem }}</li>
  116.                                         {% endfor %}
  117.                                     </ul>
  118.                                 {% else %}
  119.                                     {{ additionalValue }}
  120.                                 {% endif %}
  121.                             </td>
  122.                         {% endfor %}
  123.                     {% endif %}
  124.                     <td>
  125.                         {{- 'app.notifications.profiles.types.%s'|format(profile.roleTypeName)|trans() -}}
  126.                     </td>
  127.                     {% if not minimal %}
  128.                         <td>
  129.                             {{- 'app.notifications.reachability.%s'|format(profile.reachabilityIndex)|trans -}}
  130.                         </td>
  131.                         <td>
  132.                             {{- profile.timestampedAt|ui_relativeDate -}}
  133.                         </td>
  134.                     {% endif %}
  135.                 </tr>
  136.             {% endfor %}
  137.         {% endif %}
  138.     {% endblock %}
  139. {% endembed %}