src/App/Resources/views/dashboard/settings/accounts/includes/_results.html.twig line 1

Open in your IDE?
  1. {% set headers = _args.headers|default([
  2.     {
  3.         title: 'Name',
  4.         spacing: 35,
  5.         sort: 'name',
  6.     },
  7.     {
  8.         title: 'Email',
  9.         sort: 'email',
  10.     },
  11.     {
  12.         title: 'Status',
  13.         sort: 'active',
  14.     },
  15.     {
  16.         title: 'Synced',
  17.         spacing: 5,
  18.         sort: 'oneroster',
  19.     },
  20.     {
  21.         title: 'Last Login',
  22.         sort: 'last_login',
  23.     },
  24.     {
  25.         title: 'Last Modified',
  26.         sort: 'timestamp',
  27.     },
  28. ]) %}
  29. {% embed '@ui2022/table--search.html.twig' with {
  30.     form: form,
  31.     headers: headers,
  32.     pagination: pagination,
  33. } %}
  34.     {% block items %}
  35.         {% if accounts is empty %}
  36.             {% include '@ui2022/table__empty.html.twig' with {
  37.                 title: 'No accounts found',
  38.                 message: 'No accounts matching the criteria were found in the system.'
  39.             } %}
  40.         {% else %}
  41.             {% for account in accounts %}
  42.                 <tr>
  43.                     {% include '@ui2022/table__item__cell--status.html.twig' with {
  44.                         title: account.displayName,
  45.                         link: path('app.app.dashboard.settings.accounts.roles.main', {
  46.                             account: account.id,
  47.                         }),
  48.                         sidepanel: sidepanel,
  49.                         actions: [
  50.                              {
  51.                                 text: 'Edit',
  52.                                 link:  path('app.app.dashboard.settings.accounts.update', {
  53.                                     account: account.id,
  54.                                 }),
  55.                                 sidepanel: sidepanel,
  56.                             },
  57.                             {
  58.                                 text: 'More',
  59.                                 dropdown: {
  60.                                     items: [
  61.                                         account.active ? ({
  62.                                             text: 'Deactivate',
  63.                                             link: path('app.app.dashboard.settings.accounts.deactivate', {
  64.                                                 account: account.id,
  65.                                             }),
  66.                                             modal: 'modal__result',
  67.                                         }) : ({
  68.                                             text: 'Reactivate',
  69.                                             link: path('app.app.dashboard.settings.accounts.reactivate', {
  70.                                                 account: account.id,
  71.                                             }),
  72.                                             modal: 'modal__result',
  73.                                         }),
  74.                                         account.canManagePassword ? ({
  75.                                             text: 'Manage Password',
  76.                                             link: path('app.app.dashboard.settings.accounts.manage_password', {
  77.                                                 account: account.id,
  78.                                             }),
  79.                                             modal: 'modal__result',
  80.                                         }) : null,
  81.                                     ]
  82.                                 },
  83.                             }
  84.                         ],
  85.                     } %}
  86.                     {% include '@ui2022/table__item__cell--default.html.twig' with {
  87.                         text: account.email,
  88.                         link: path('app.app.dashboard.settings.accounts.roles.main', {
  89.                             account: account.id,
  90.                         }),
  91.                         sidepanel: sidepanel,
  92.                     } %}
  93.                     <td>{{ account.active ? 'Active' : 'Inactive' }}</td>
  94.                     <td>{{ account.oneRoster ? '<i class="icon-check"></i>' : '' }}</td>
  95.                     <td>
  96.                         {{- account.lastLoggedInAt ? account.lastLoggedInAt|ui_relativeDate : '' -}}
  97.                     </td>
  98.                     <td>
  99.                         {{- account.touchedAt|ui_relativeDate -}}
  100.                     </td>
  101.                 </tr>
  102.             {% endfor %}
  103.         {% endif %}
  104.     {% endblock %}
  105. {% endembed %}