From 4fb5564ee87176e72802241462eedf4f94dba39a Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+studip@gmail.com>
Date: Wed, 4 Sep 2024 08:26:58 +0000
Subject: [PATCH] fix alignment and reduction of breadcrumbs in content bar,
 fixes #4503

Closes #4503

Merge request studip/studip!3292
---
 resources/assets/stylesheets/scss/contentbar.scss | 3 +--
 templates/contentbar/contentbar.php               | 6 +++---
 templates/toc/_toc-item-breadcrumb.php            | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/resources/assets/stylesheets/scss/contentbar.scss b/resources/assets/stylesheets/scss/contentbar.scss
index a7df7f734d0..01e586ffe56 100644
--- a/resources/assets/stylesheets/scss/contentbar.scss
+++ b/resources/assets/stylesheets/scss/contentbar.scss
@@ -16,10 +16,9 @@
 
     .contentbar-wrapper-left {
         display: flex;
-        flex: auto;
+        max-width: calc(100% - 130px);
 
         .contentbar-breadcrumb {
-            display: flex;
             font-size: 1.25em;
             line-height: 1.5em;
             margin-right: 1em;
diff --git a/templates/contentbar/contentbar.php b/templates/contentbar/contentbar.php
index f9b42edc6b2..a4632ca43a4 100644
--- a/templates/contentbar/contentbar.php
+++ b/templates/contentbar/contentbar.php
@@ -13,11 +13,11 @@
         <nav class="contentbar-nav"></nav>
         <div class="contentbar-wrapper-left">
             <nav class="contentbar-breadcrumb">
-            <? if (!$toc->isActive()) : ?>
+            <? if ($toc->isActive()): ?>
+                <?= $icon->asImg(24, ['class' => 'text-bottom contentbar-icon']) ?>
+            <? else: ?>
                 <a href="<?= $toc->getUrl() ?>" title="<?= htmlReady($toc->getTitle()) ?>" class="contentbar-icon">
-            <? endif ?>
                     <?= $icon->asImg(24, ['class' => 'text-bottom']) ?>
-            <? if (!$toc->isActive()) : ?>
                 </a>
             <? endif ?>
                 <?= $breadcrumbs->render() ?>
diff --git a/templates/toc/_toc-item-breadcrumb.php b/templates/toc/_toc-item-breadcrumb.php
index 4ea48c4a490..d87419dd135 100644
--- a/templates/toc/_toc-item-breadcrumb.php
+++ b/templates/toc/_toc-item-breadcrumb.php
@@ -1,7 +1,7 @@
 <? if (!$item->isRoot()) : ?>
     <?= $this->render_partial('toc/_toc-item-breadcrumb', ['item' => $item->getParent()]) ?>
 <? endif ?>
-<li>
+<li class="contentbar-breadcrumb-item <? if ($item->isActive()) echo 'contentbar-breadcrumb-item-current'; ?>">
     <? if (!$item->isActive()) : ?>
         <a class="navigate" href="<?= htmlReady($item->getURL()) ?>">
     <? endif ?>
-- 
GitLab