diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php index f5782b7..6ace512 100644 --- a/core/modules/system/src/Tests/System/FrontPageTest.php +++ b/core/modules/system/src/Tests/System/FrontPageTest.php @@ -57,10 +57,13 @@ public function testDrupalFrontPage() { $this->assertTitle('Home | Drupal'); $this->assertText(t('On front page.'), 'Path is the front page.'); + $this->assertRaw('"currentPath":""'); $this->drupalGet('node'); $this->assertText(t('On front page.'), 'Path is the front page.'); + $this->assertRaw('"currentPath":""'); $this->drupalGet($this->nodePath); $this->assertNoText(t('On front page.'), 'Path is not the front page.'); + $this->assertNoRaw('"currentPath":""'); // Change the front page to an invalid path. $edit = ['site_frontpage' => '/kittens']; @@ -79,10 +82,13 @@ public function testDrupalFrontPage() { $this->drupalGet(''); $this->assertText(t('On front page.'), 'Path is the front page.'); + $this->assertRaw('"currentPath":""'); $this->drupalGet('node'); $this->assertNoText(t('On front page.'), 'Path is not the front page.'); + $this->assertNoRaw('"currentPath":""'); $this->drupalGet($this->nodePath); $this->assertText(t('On front page.'), 'Path is the front page.'); + $this->assertRaw('"currentPath":""'); } } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index a1a6b71..66e9b83 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -717,12 +717,13 @@ function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) { } $current_path = $route_match->getRouteName() ? Url::fromRouteMatch($route_match)->getInternalPath() : ''; $current_path_is_admin = \Drupal::service('router.admin_context')->isAdminRoute($route_match->getRouteObject()); + $is_front_page = \Drupal::service('path.matcher')->isFrontPage(); $path_settings = [ 'baseUrl' => $request->getBaseUrl() . '/', 'pathPrefix' => $pathPrefix, - 'currentPath' => $current_path, + 'currentPath' => $is_front_page ? '' : $current_path, 'currentPathIsAdmin' => $current_path_is_admin, - 'isFront' => \Drupal::service('path.matcher')->isFrontPage(), + 'isFront' => $is_front_page, 'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(), ]; if (!empty($current_query)) { diff --git a/core/themes/bartik/css/components/sidebar.css b/core/themes/bartik/css/components/sidebar.css index 8b56352..b39886e 100644 --- a/core/themes/bartik/css/components/sidebar.css +++ b/core/themes/bartik/css/components/sidebar.css @@ -56,6 +56,7 @@ .sidebar .block .content { font-size: 0.914em; line-height: 1.4; + margin-top: 1em; } .sidebar tbody { border: none; @@ -65,3 +66,26 @@ background: none; border-bottom: 1px solid #d6d6d6; } + +.sidebar .menu-item { + padding-top: 0; + margin: 0.7em; +} +.sidebar .menu-item a { + display: block; + padding: 0.6em; + border: solid 1px #e4e4e4; + border-radius: 40px; + background: #eaeaea; + text-align: center; +} +.sidebar .menu-item a:hover, +.sidebar .menu-item a:focus { + color: #045DA8; + background-color: #ddd; + border-bottom: solid 1px #e3e3e3; +} +.sidebar .menu-item a:active { + background-color: #fff; + border-bottom: solid 1px #e3e3e3; +}