From 3ca4bfac4f048a2e7699161d512b9e755f9c5ee4 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Fri, 28 Jul 2023 14:46:08 -0400 Subject: [PATCH] Add controller to persistent view variables, and add platform config notice to config menu panel. (CFM-310) --- app/src/Controller/AppController.php | 3 ++- app/templates/element/menuPanel.php | 23 +++++++++++++++++++++++ app/templates/layout/default.php | 9 ++++++++- app/webroot/css/co-base.css | 14 ++++++++++++++ app/webroot/css/co-responsive.css | 6 ++++++ 5 files changed, 53 insertions(+), 2 deletions(-) diff --git a/app/src/Controller/AppController.php b/app/src/Controller/AppController.php index 28cb84569..d58ec87e3 100644 --- a/app/src/Controller/AppController.php +++ b/app/src/Controller/AppController.php @@ -140,7 +140,8 @@ public function beforeRender(\Cake\Event\EventInterface $event) { $modelsName = $this->name; // Views can also inspect the request object to determine the current - // action, but it seems slightly easier to do it once here. + // controller and action, but it seems slightly easier to do it once here. + $this->set('vv_controller', $this->request->getParam('controller')); $this->set('vv_action', $this->request->getParam('action')); if(isset($this->RegistryAuth)) { diff --git a/app/templates/element/menuPanel.php b/app/templates/element/menuPanel.php index fd519e7c2..9e967ac46 100644 --- a/app/templates/element/menuPanel.php +++ b/app/templates/element/menuPanel.php @@ -398,6 +398,29 @@ */ ?> + id != 1 && $vv_user_roles['platform']): ?> + Url->build([ + 'plugin' => null, + 'controller' => 'dashboards', + 'action' => 'configuration', + '?' => [ + 'co_id' => 1 + ]]), + $this->Url->build([ + 'plugin' => null, + 'controller' => 'dashboards', + 'action' => 'dashboard', + '?' => [ + 'co_id' => 1 + ]]) + ]; + ?> +
+ Alert->alert(__d('information','cmp.config.notice', $noticeUrls), 'information', true) ?> +
+
diff --git a/app/templates/layout/default.php b/app/templates/layout/default.php index 23a01020e..5d332a029 100644 --- a/app/templates/layout/default.php +++ b/app/templates/layout/default.php @@ -91,6 +91,13 @@ } else { $bodyClasses .= ' logged-out'; } + + // add hints that we're in the platform-level (COmanage) CO + $isPlatformCO = false; + if(!empty($vv_cur_co) && ($vv_cur_co->id == 1) && !($vv_controller == 'Cos' && $vv_action == 'select')) { + $isPlatformCO = true; + $bodyClasses .= ' platform-co'; + } ?>
@@ -160,7 +167,7 @@
- id == 1) && ($vv_action != 'select')): ?> + Url->build([ 'plugin' => null, diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 6d53a6917..64124e29d 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -923,6 +923,20 @@ h2.config-subtitle { .config-platform-notice { margin: 4em 0 -3em; } +#main-menu .menu-panel .config-platform-notice { + margin: 0 0 1em; +} +#main-menu .menu-panel .config-platform-notice a { + display: inline; + padding: 0; +} +#main-menu .menu-panel .config-platform-notice a:hover { + background-color: unset; + text-decoration: underline; +} +#main-menu .menu-panel .config-platform-notice .material-icons-outlined { + font-size: 24px; +} /* INDEX ACTION COMMAND MENUS */ a.action-menu-toggle { padding: 0.5rem; diff --git a/app/webroot/css/co-responsive.css b/app/webroot/css/co-responsive.css index 3bccd3e82..a886515d3 100644 --- a/app/webroot/css/co-responsive.css +++ b/app/webroot/css/co-responsive.css @@ -232,6 +232,9 @@ #advanced-menu { margin-top: 2rem; } + body.platform-co #advanced-menu li a { + padding: 0.25em; + } #co-menu-collapse { display: flex; justify-content: center; @@ -287,6 +290,9 @@ bottom: 2rem; margin: 0; } + #main-menu .menu-panel .config-platform-notice { + margin: 10em 0 4em; + } /* GENERAL */ .table-container { overflow: unset;