Skip to content
Snippets Groups Projects
Commit 87f01081 authored by Erik Seifert's avatar Erik Seifert
Browse files

Fix: add dashboard icon

parent b16e0c84
No related branches found
No related tags found
No related merge requests found
.toolbar-icon-dashboard:before {
background-image: url(../images/dashboard.svg);
}
.toolbar .toolbar-menu-administration-dashboard.item-list ul li {
margin: 0;
.toolbar-bar .toolbar-item.toolbar-menu-administration-dashboard:before {
background-image:url("../images/dashboard.svg");
}
@keyframes pulse-throbber {
......
......@@ -57,10 +57,21 @@ function dashboards_toolbar() {
'tags' => [
'config:dashboard_list',
],
'contexts' => [
'user.permissions',
],
],
];
$boards = \Drupal::entityManager()->getStorage('dashboard')->loadMultiple();
$entityTypeManager = \Drupal::entityTypeManager();
$boards = $entityTypeManager->getStorage('dashboard')->loadMultiple();
foreach ($boards as $key => $board) {
if (!$board->access('view', \Drupal::currentUser())) {
unset($boards[$key]);
}
}
$boards = array_values($boards);
$links = [];
foreach ($boards as $board) {
$link = $board->toLink($board->label())->toRenderable();
......@@ -74,7 +85,7 @@ function dashboards_toolbar() {
'#title' => t('Dashboards'),
'#url' => Url::fromRoute('<current>'),
'#attributes' => [
'class' => ['toolbar-icon-dashboard'],
'class' => ['toolbar-icon', 'toolbar-menu-administration-dashboard'],
],
],
'tray' => [
......@@ -86,9 +97,6 @@ function dashboards_toolbar() {
'class' => ['toolbar-menu'],
],
'#items' => $links,
'#wrapper_attributes' => [
'class' => ['toolbar-menu-administration-dashboard'],
],
],
],
'#weight' => 150,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment