Commit d8ef8373 authored by Kevin Paxman's avatar Kevin Paxman Committed by Erik Seifert
Browse files

Issue #3298650 by kpaxman, Erik Seifert: Treat dashboards as admin pages (if in admin theme)

parent 459fe64f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -74,3 +74,7 @@
.dashboard-gin-panel.panel .views-table th {
  border-radius: 0;
}

html.dashboard .toolbar .toolbar-bar .home-toolbar-tab {
  display: block;
}
 No newline at end of file
+13 −0
Original line number Diff line number Diff line
@@ -146,6 +146,9 @@ function dashboards_form_dashboard_form_alter(&$form, FormStateInterface $form_s
  \Drupal::classResolver(FormAlter::class)->alterEntityViewDisplayForm($form, $form_state, $form_id);
}

/**
 * Implements hook_preprocess_block().
 */
function dashboards_preprocess_block(&$variables) {
  if (
    isset($variables['attributes']) &&
@@ -160,3 +163,13 @@ function dashboards_preprocess_block(&$variables) {
    ];
  }
}

/**
 * Implements hook_preprocess_html().
 */
function dashboards_preprocess_html(&$variables) {
  $route = \Drupal::routeMatch()->getRouteName();
  if (strpos($route, "entity.dashboard") === 0) {
    $variables['html_attributes']['class'] = 'dashboard';
  }
}
 No newline at end of file