<?php
$toolbarFilterSchema = is_array($toolbarFilterSchema ?? null) ? $toolbarFilterSchema : [];
$searchToolbarFilterSchema = is_array($searchToolbarFilterSchema ?? null) ? $searchToolbarFilterSchema : [];
$drawerToolbarFilterSchema = is_array($drawerToolbarFilterSchema ?? null) ? $drawerToolbarFilterSchema : [];
$toolbarFilterState = is_array($toolbarFilterState ?? null) ? $toolbarFilterState : [];
$clientFilterSchema = is_array($clientFilterSchema ?? null) ? $clientFilterSchema : [];
$searchConfig = is_array($searchConfig ?? null) ? $searchConfig : null;
$filterChipMeta = is_array($filterChipMeta ?? null) ? $filterChipMeta : [];
?>
<?php
$listTitle = t('Check templates');
ob_start();
?>
<a role="button" class="app-action-success" href="<?php e(requestPathWithReturnTarget('security/templates/create', \MintyPHP\Http\Request::pathWithQuery())); ?>">
  <i class="bi bi-plus"></i> <?php e(t('New template')); ?>
</a>
<?php
$listTitleActionsHtml = ob_get_clean();
require templatePath('partials/app-list-titlebar.phtml');
?>

<?php
$filterUiNamespace = 'security-templates';
require templatePath('partials/app-list-filters.phtml');
?>
<div class="app-list-table">
  <div id="security-templates-grid"></div>
</div>

<script src="<?php e(assetVersion('vendor/gridjs/gridjs.umd.js')); ?>"></script>
<script type="application/json" id="page-config-security-templates"><?php gridJsonForJs([
    'dataUrl' => lurl('security/templates-data'),
    'gridLang' => gridLang(),
    'gridSearch' => $searchConfig,
    'filterSchema' => $clientFilterSchema,
    'filterChipMeta' => $filterChipMeta,
    'editBaseUrl' => lurl('security/templates/edit/'),
    'labels' => [
        'productName' => t('Product'),
        'productCode' => t('Code'),
        'itemCount' => t('Checklist items'),
        'active' => t('Active'),
        'updatedAt' => t('Updated'),
        'yes' => t('Yes'),
        'no' => t('No'),
    ],
]); ?></script>
<script type="module" src="<?php e(assetVersion('modules/security/js/pages/security-templates-index.js')); ?>"></script>
