From b4fe51966db100254c40ab485eb3a79f56872280 Mon Sep 17 00:00:00 2001 From: iglocska Date: Sun, 21 Jun 2020 21:35:33 +0200 Subject: [PATCH] chg: [index] factories modified to make index views leaner for ajax rendering --- .../genericElements/IndexTable/index_table.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/templates/element/genericElements/IndexTable/index_table.php b/app/templates/element/genericElements/IndexTable/index_table.php index 5778fa1..a138bb7 100644 --- a/app/templates/element/genericElements/IndexTable/index_table.php +++ b/app/templates/element/genericElements/IndexTable/index_table.php @@ -18,10 +18,10 @@ */ $tableRandomValue = Cake\Utility\Security::randomString(8); echo '
'; - if (!empty($data['title'])) { + if (!$ajax && !empty($data['title'])) { echo sprintf('

%s

', h($data['title'])); } - if (!empty($data['description'])) { + if (!$ajax && !empty($data['description'])) { echo sprintf( '
%s
', empty($data['description']) ? '' : h($data['description']) @@ -40,9 +40,11 @@ 'tableRandomValue' => $tableRandomValue ) ); - echo $this->element( - '/genericElements/IndexTable/pagination_links' - ); + if (!$ajax) { + echo $this->element( + '/genericElements/IndexTable/pagination_links' + ); + } } if (!empty($data['top_bar'])) { echo $this->element(