chg: [index] factories modified to make index views leaner for ajax rendering

remotes/origin/main
iglocska 2020-06-21 21:35:33 +02:00
parent 2f8c3ebe3a
commit b4fe51966d
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 7 additions and 5 deletions

View File

@ -18,10 +18,10 @@
*/
$tableRandomValue = Cake\Utility\Security::randomString(8);
echo '<div id="table-container-' . h($tableRandomValue) . '">';
if (!empty($data['title'])) {
if (!$ajax && !empty($data['title'])) {
echo sprintf('<h2>%s</h2>', h($data['title']));
}
if (!empty($data['description'])) {
if (!$ajax && !empty($data['description'])) {
echo sprintf(
'<div>%s</div>',
empty($data['description']) ? '' : h($data['description'])
@ -40,10 +40,12 @@
'tableRandomValue' => $tableRandomValue
)
);
if (!$ajax) {
echo $this->element(
'/genericElements/IndexTable/pagination_links'
);
}
}
if (!empty($data['top_bar'])) {
echo $this->element(
'/genericElements/ListTopBar/scaffold',