chg: [navigation] Fixed navigation for tag endpoints

pull/72/head
mokaddem 2021-09-17 18:30:32 +02:00
parent 0c38ee1532
commit cf3e87614e
3 changed files with 29 additions and 4 deletions

View File

@ -13,6 +13,22 @@ $routes->plugin(
['controller' => 'Tags']
);
$routes->get('/', ['controller' => 'Tags', 'action' => 'index']);
// $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']);
// $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']);
}
);
$routes->plugin(
'Tags',
['path' => '/Tags'],
function ($routes) {
$routes->setRouteClass(DashedRoute::class);
$routes->connect(
'/{action}/*',
['controller' => 'Tags']
);
$routes->get('/', ['controller' => 'Tags', 'action' => 'index']);
// $routes->get('/{id}', ['controller' => 'Tags', 'action' => 'view']);
// $routes->put('/{id}', ['controller' => 'Tags', 'action' => 'edit']);

View File

@ -26,6 +26,7 @@ class NavigationComponent extends Component
'MetaTemplates' => 'object-group',
'LocalTools' => 'tools',
'Instance' => 'server',
'Tags' => 'tags',
];
public function initialize(array $config): void
@ -112,7 +113,12 @@ class NavigationComponent extends Component
'label' => __('Local Tools'),
'icon' => $this->iconToTableMapping['LocalTools'],
'url' => '/localTools/index',
]
],
'Tags.index' => [
'label' => __('Tags'),
'icon' => $this->iconToTableMapping['Tags'],
'url' => '/tags/index',
],
]
],
'LocalTools' => [
@ -364,6 +370,9 @@ class NavigationComponent extends Component
],
]
]),
'Tags' => $this->getDefaultCRUDConfig('Tags', [
'defaults' => ['depth-1' => ['textGetter' => 'label']]
]),
'LocalTools' => [
'routes' => [
'LocalTools:index' => [

View File

@ -7,16 +7,16 @@ use Cake\Routing\Router;
</a>
<div class="dropdown-menu dropdown-menu-end">
<h6 class="dropdown-header"><?= h($this->request->getAttribute('identity')['username']) ?></h6>
<a class="dropdown-item" href="<?= Router::url(['controller' => 'users', 'action' => 'view']) ?>">
<a class="dropdown-item" href="<?= Router::url(['controller' => 'users', 'action' => 'view', 'plugin' => null]) ?>">
<i class="me-1 <?= $this->FontAwesome->getClass('user-circle') ?>"></i>
<?= __('My Account') ?>
</a>
<a class="dropdown-item" href="<?= Router::url(['controller' => 'users', 'action' => 'userSettings']) ?>">
<a class="dropdown-item" href="<?= Router::url(['controller' => 'users', 'action' => 'userSettings', 'plugin' => null]) ?>">
<i class="me-1 <?= $this->FontAwesome->getClass('user-cog') ?>"></i>
<?= __('Settings') ?>
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="<?= Router::url(['controller' => 'users', 'action' => 'logout']) ?>">
<a class="dropdown-item" href="<?= Router::url(['controller' => 'users', 'action' => 'logout', 'plugin' => null]) ?>">
<i class="me-1 <?= $this->FontAwesome->getClass('sign-out-alt') ?>"></i>
<?= __('Logout') ?>
</a>