src/Platform/ControlPanelBundle/Resources/views/Dashboard/Tenant/list.html.twig line 1

Open in your IDE?
  1. {% extends '@PlatformControlPanel/base.html.twig' %}
  2. {% block header %}
  3.     {% embed '@ui/common/headers/new.html.twig' with {
  4.         subtitle: 'Tenants',
  5.         title: (app.request.attributes.get('primary') is not empty and app.request.attributes.get('primary') in constant('Cms\\TenantBundle\\Entity\\TenantTypeEmbeddable::PRIMARY')) ? 'campussuite.cms.tenant.types.primary.%s'|format(app.request.attributes.get('primary'))|trans : 'All',
  6.         dropdown: false
  7.     } %}
  8.         {% block actions %}
  9.             {% include '@ui/common/buttons/default.html.twig' with {
  10.                 text: 'Tenant',
  11.                 link: path(routes.create),
  12.                 icon: 'plus',
  13.                 helper: 'primary'
  14.             } %}
  15.         {% endblock %}
  16.     {% endembed %}
  17.     {% include '@PlatformControlPanel/Dashboard/Tenant/includes/navbar.html.twig' %}
  18. {% endblock %}
  19. {% block content %}
  20.     {{ embed_title('Control Panel', 10) }}
  21.     {{ embed_title('Tenants', 20) }}
  22.     {% include '@ui/common/flash/default.html.twig' %}
  23.     <h4>Current Tenant <small>(always shows despite filtering)</small></h4>
  24.     {% embed '@ui/common/data/list.html.twig' with {
  25.         lazyload: false,
  26.     } %}
  27.         {% block items %}
  28.             {% for tenant in [current] %}
  29.                 {% include '@PlatformControlPanel/Dashboard/Tenant/includes/tenant.html.twig' %}
  30.             {% endfor %}
  31.         {% endblock %}
  32.     {% endembed %}
  33.     <h4>Results <small>(for current filtering selections)</small></h4>
  34.     {% embed '@ui/common/actionbar/default.html.twig' with {
  35.         search: search
  36.     } %}
  37.         {% block searchbox %}
  38.             {% include '@ui/common/actionbar/searchbox.html.twig' with {
  39.                 term: search.filter('name')
  40.             } %}
  41.         {% endblock %}
  42.     {% endembed %}
  43.     {% embed '@ui/common/data/list.html.twig' with {
  44.         lazyload: false,
  45.     } %}
  46.         {% block items %}
  47.             {% for tenant in tenants %}
  48.                 {% include '@PlatformControlPanel/Dashboard/Tenant/includes/tenant.html.twig' %}
  49.             {% endfor %}
  50.         {% endblock %}
  51.     {% endembed %}
  52.     {% include '@CmsCore/includes/Search/empty.html.twig' with {
  53.         results: tenants|length
  54.     } %}
  55.     {% inline_script %}
  56.         <script>
  57.             $(function () {
  58.                 var $search = $('[data-campussuite-search-term="name"] input');
  59.                 var $list = $('div.action-bar+ul.module-list');
  60.                 var $items = $list.children('li');
  61.                 $search.on('keyup', function (e) {
  62.                     var val = $search.val().toLowerCase().trim();
  63.                     if (val.length >= 3) {
  64.                         $items.each(function (index, elem) {
  65.                             var $elem = $(elem);
  66.                             $elem.toggle($elem.is('[data-tenant-search*="' + val + '"]'));
  67.                         });
  68.                     } else {
  69.                         $items.show();
  70.                     }
  71.                 });
  72.                 $search.focus();
  73.             });
  74.         </script>
  75.     {% endinline %}
  76. {% endblock %}