From a5d9dd4fb9f4264626776c67c4013a7687214669 Mon Sep 17 00:00:00 2001 From: Piotr Surowiec Date: Thu, 22 Jul 2021 15:52:25 +0200 Subject: [PATCH] fix: hide unavailable sequence title in course breadcrumbs (#28028) When a sequence title was unavailable for a user (e.g. before starting a timed exam), the `None` value was displayed in course breadcrumbs. This hides it in such cases and ensures that a trailing breadcrumb separator is not displayed. --- .../static/sass/edx-pattern-library-shims/_breadcrumbs.scss | 5 +++++ lms/templates/courseware/courseware.html | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/static/sass/edx-pattern-library-shims/_breadcrumbs.scss b/common/static/sass/edx-pattern-library-shims/_breadcrumbs.scss index 79e0a7a08f..8bd18361d1 100644 --- a/common/static/sass/edx-pattern-library-shims/_breadcrumbs.scss +++ b/common/static/sass/edx-pattern-library-shims/_breadcrumbs.scss @@ -57,5 +57,10 @@ @include rtl { @include transform(rotateY(180deg)); } + + // Hide a trailing separator. + &:last-child { + display: none; + } } } diff --git a/lms/templates/courseware/courseware.html b/lms/templates/courseware/courseware.html index 5cba0fcd49..c1525f2063 100644 --- a/lms/templates/courseware/courseware.html +++ b/lms/templates/courseware/courseware.html @@ -237,7 +237,9 @@ ${HTML(fragment.foot_html())} % endif - ${sequence_title} + % if sequence_title: + ${sequence_title} + % endif