fix: [templates] left off

pull/32/head
iglocska 2020-09-28 01:26:50 +02:00
parent 4fd2c3b548
commit f09e8ce3c7
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 125 additions and 0 deletions

View File

@ -0,0 +1,85 @@
<?php
echo $this->element('genericElements/IndexTable/index_table', [
'data' => [
'data' => $data,
'top_bar' => [
'pull' => 'right',
'children' => [
[
'type' => 'search',
'button' => __('Filter'),
'placeholder' => __('Enter value to search'),
'data' => '',
'searchKey' => 'value'
]
]
],
'fields' => [
[
'name' => '#',
'sort' => 'id',
'data_path' => 'id',
],
[
'name' => __('Scope'),
'sort' => 'scope',
'data_path' => 'scope',
],
[
'name' => __('Name'),
'sort' => 'name',
'data_path' => 'name',
],
[
'name' => __('Namespace'),
'sort' => 'namespace',
'data_path' => 'namespace',
],
[
'name' => __('UUID'),
'sort' => 'uuid',
'data_path' => 'uuid'
],
[
'name' => 'Enabled',
'sort' => 'enabled',
'data_path' => 'enabled',
'element' => 'boolean'
],
],
'title' => __('Meta Field Templates'),
'description' => __('The various templates used to enrich certain objects by a set of standardised fields.'),
'pull' => 'right',
'actions' => [
[
'url' => '/metaTemplates/view',
'url_params_data_paths' => ['id'],
'icon' => 'eye'
],
[
'url' => '/metaTemplates/enable',
'url_params_data_paths' => ['id'],
'title' => __('Enable template'),
'icon' => 'plus',
'complex_requirement' => [
'function' => function($row, $options) {
return !(bool)$row['enabled'];
}
]
],
[
'url' => '/metaTemplates/disable',
'url_params_data_paths' => ['id'],
'title' => __('DIsable template'),
'icon' => 'minus',
'complex_requirement' => [
'function' => function($row, $options) {
return (bool)$row['enabled'];
}
]
]
]
]
]);
?>

View File

@ -0,0 +1,40 @@
<?php
echo $this->element(
'/genericElements/SingleViews/single_view',
[
'data' => $entity,
'fields' => [
[
'key' => __('ID'),
'path' => 'id'
],
[
'key' => __('Name'),
'path' => 'name'
],
[
'key' => __('Namespace'),
'path' => 'namespace'
],
[
'key' => __('Description'),
'path' => 'description'
],
[
'key' => __('Version'),
'path' => 'version'
],
[
'key' => __('Source'),
'path' => 'source'
]
],
'children' => [
[
'url' => '/MetaTemplateFields/index?meta_template_id={{0}}',
'url_params' => ['id'],
'title' => __('Fields')
]
]
]
);