{% extends '@PlatformControlPanel/base.html.twig' %}
{% block header %}
{% embed '@ui/common/headers/new.html.twig' with {
subtitle: 'Tenants',
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',
dropdown: false
} %}
{% block actions %}
{% include '@ui/common/buttons/default.html.twig' with {
text: 'Tenant',
link: path(routes.create),
icon: 'plus',
helper: 'primary'
} %}
{% endblock %}
{% endembed %}
{% include '@PlatformControlPanel/Dashboard/Tenant/includes/navbar.html.twig' %}
{% endblock %}
{% block content %}
{{ embed_title('Control Panel', 10) }}
{{ embed_title('Tenants', 20) }}
{% include '@ui/common/flash/default.html.twig' %}
<h4>Current Tenant <small>(always shows despite filtering)</small></h4>
{% embed '@ui/common/data/list.html.twig' with {
lazyload: false,
} %}
{% block items %}
{% for tenant in [current] %}
{% include '@PlatformControlPanel/Dashboard/Tenant/includes/tenant.html.twig' %}
{% endfor %}
{% endblock %}
{% endembed %}
<h4>Results <small>(for current filtering selections)</small></h4>
{% embed '@ui/common/actionbar/default.html.twig' with {
search: search
} %}
{% block searchbox %}
{% include '@ui/common/actionbar/searchbox.html.twig' with {
term: search.filter('name')
} %}
{% endblock %}
{% endembed %}
{% embed '@ui/common/data/list.html.twig' with {
lazyload: false,
} %}
{% block items %}
{% for tenant in tenants %}
{% include '@PlatformControlPanel/Dashboard/Tenant/includes/tenant.html.twig' %}
{% endfor %}
{% endblock %}
{% endembed %}
{% include '@CmsCore/includes/Search/empty.html.twig' with {
results: tenants|length
} %}
{% inline_script %}
<script>
$(function () {
var $search = $('[data-campussuite-search-term="name"] input');
var $list = $('div.action-bar+ul.module-list');
var $items = $list.children('li');
$search.on('keyup', function (e) {
var val = $search.val().toLowerCase().trim();
if (val.length >= 3) {
$items.each(function (index, elem) {
var $elem = $(elem);
$elem.toggle($elem.is('[data-tenant-search*="' + val + '"]'));
});
} else {
$items.show();
}
});
$search.focus();
});
</script>
{% endinline %}
{% endblock %}