diff --git a/cms/static/sass/course-unit-mfe-iframe-bundle.scss b/cms/static/sass/course-unit-mfe-iframe-bundle.scss index ac3a6b2cf9e7..42ce2948f0d9 100644 --- a/cms/static/sass/course-unit-mfe-iframe-bundle.scss +++ b/cms/static/sass/course-unit-mfe-iframe-bundle.scss @@ -1174,3 +1174,11 @@ select { @extend %button-primary-outline; } } + +.tooltip { + background: $primary-base; + white-space: normal; + max-width: 200px; + line-height: 1.5; + text-align: center; +} diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index ae786f9ca1b6..14bc6a28959b 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -1,7 +1,7 @@ <%page expression_filter="h"/> <%! from django.utils.translation import gettext as _ -from openedx.core.djangolib.markup import Text +from openedx.core.djangolib.markup import HTML, Text from cms.djangoapps.contentstore.helpers import xblock_studio_url from cms.djangoapps.contentstore.utils import is_visible_to_specific_partition_groups, get_editor_page_base_url, determine_label from lms.lib.utils import is_unit @@ -111,7 +111,7 @@ % else: % if upstream_info.upstream_ref: % if upstream_info.error_message: -
+
${_("The referenced library or library object is not available.")} + ${_("The referenced library or library object is not available")}
% elif upstream_info.ready_to_sync: - % elif len(upstream_info.downstream_customized) > 0: -
+
${_("This library reference has course overrides applied.")} + ${_("This library reference has course overrides applied")}
% else: -
+
{name}').format(name=upstream_info.upstream_name))}"> - ${_("This item is linked to a library item.")} + ${_("This item is linked to a library item")}
% endif % endif diff --git a/common/static/js/src/tooltip_manager.js b/common/static/js/src/tooltip_manager.js index 71db826a705d..bc30a6641154 100644 --- a/common/static/js/src/tooltip_manager.js +++ b/common/static/js/src/tooltip_manager.js @@ -69,8 +69,10 @@ pageX = typeof pageX !== 'undefined' ? pageX : element.offset().left + element.width() / 2; pageY = typeof pageY !== 'undefined' ? pageY : element.offset().top + element.height() / 2; var tooltipText = $(element).attr('data-tooltip'); + // Tooltip content comes from data-tooltip attributes which are server-rendered + // with proper escaping using Text() and HTML() from openedx.core.djangolib.markup this.tooltip - .text(tooltipText) + .html(tooltipText) // xss-lint: disable=javascript-jquery-html .css(this.getCoords(pageX, pageY)); },