From 9b995a68c64122c09b5891113863e640e3398dd9 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Mon, 11 Apr 2022 19:08:49 +0300 Subject: [PATCH 1/3] Top links on the index view --- app/templates/Standard/index.php | 76 +++++++++++++++++++------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 9a10ee5ca..751378bfc 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -91,38 +91,52 @@ function _column_key($modelsName, $c, $tz=null) {

- - - + + $action_args['vv_actions'][] = [ + 'order' => $this->Menu->getMenuOrder($t['icon']), + 'icon' => $this->Menu->getMenuIcon($t['icon']), + 'url' => $this->Url->build($t['link']), + 'label' => $t['label'], + ]; + } + } + } + + if(!empty($action_args['vv_actions'])) { + print ''; + } + ?> From 08fa6ac1512c913405d44599015c1b4b8493a2a1 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Sun, 1 May 2022 13:37:04 +0300 Subject: [PATCH 2/3] Fixes required after Filtering feature initial commit --- app/src/Lib/Traits/SearchFilterTrait.php | 8 +++++--- app/src/View/Helper/MenuHelper.php | 3 ++- app/templates/Standard/index.php | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/Lib/Traits/SearchFilterTrait.php b/app/src/Lib/Traits/SearchFilterTrait.php index 6a13472f9..dd05c5fe3 100644 --- a/app/src/Lib/Traits/SearchFilterTrait.php +++ b/app/src/Lib/Traits/SearchFilterTrait.php @@ -29,6 +29,8 @@ namespace App\Lib\Traits; +use Cake\Utility\Inflector; + trait SearchFilterTrait { // Array (and configuration) of permitted search filters private $searchFilters = array(); @@ -54,9 +56,9 @@ public function getLabel(string $attribute): string { if($l != $attribute) { return $l; } - - // If we make it here, just return $attribute - return $attribute; + + // If we make it here, just return a pretty version of the $attribute name + return Inflector::humanize($attribute); } /** diff --git a/app/src/View/Helper/MenuHelper.php b/app/src/View/Helper/MenuHelper.php index 3ac9dd8b6..0752e1052 100644 --- a/app/src/View/Helper/MenuHelper.php +++ b/app/src/View/Helper/MenuHelper.php @@ -80,7 +80,8 @@ public function getMenuIcon($action) { 'Delete' => 'delete' ); - return $icon[$action]; + // For the actions with Default order we can pass directly the name of the icon + return $icon[$action] ?? $action; } } \ No newline at end of file diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 751378bfc..d602c32e1 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -122,7 +122,7 @@ function _column_key($modelsName, $c, $tz=null) { } $action_args['vv_actions'][] = [ - 'order' => $this->Menu->getMenuOrder($t['icon']), + 'order' => $this->Menu->getMenuOrder($t['order']), 'icon' => $this->Menu->getMenuIcon($t['icon']), 'url' => $this->Url->build($t['link']), 'label' => $t['label'], From ca17e3c535f9cc21e630dff44b7a766a2b4c516b Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Wed, 4 May 2022 16:49:36 +0300 Subject: [PATCH 3/3] Align top item at baseline --- app/webroot/css/co-base.css | 1 + 1 file changed, 1 insertion(+) diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 1d58a8619..6907b9e00 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -491,6 +491,7 @@ instead, reveal in user menu */ display: flex; justify-content: space-between; margin: 1em 0 0.5em; + align-items: baseline; } .pageTitle { padding-bottom: 0.25em;