From 09b9cdd2e456b52bf6efb7637901505ad87b5300 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Sat, 5 Oct 2024 16:09:47 -0700 Subject: [PATCH] feat: display an icon for library-sourced content --- cms/templates/studio_xblock_wrapper.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index 282629456633..6571fb2ca84a 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -8,6 +8,7 @@ dump_js_escaped_json, js_escaped_string ) from cms.djangoapps.contentstore.toggles import use_new_text_editor, use_new_problem_editor, use_new_video_editor, use_video_gallery_flow +from cms.lib.xblock.upstream_sync import UpstreamLink from openedx.core.djangoapps.content_tagging.toggles import is_tagging_feature_disabled %> <% @@ -23,6 +24,10 @@ messages = xblock.validate().to_json() has_not_configured_message = messages.get('summary',{}).get('type', None) == 'not-configured' block_is_unit = is_unit(xblock) + +upstream_info = None +if xblock.upstream: + upstream_info = UpstreamLink.try_fetch_for_block(xblock) %> <%namespace name='static' file='static_content.html'/> @@ -103,7 +108,20 @@ ${label} % else: - ${label} + % if upstream_info: + % if upstream_info.error_message: + + + ${_("Sourced from a library - but the upstream link is broken/invalid.")} + % else: + + ${_("Sourced from a library.")} + % endif + % endif + ${label} % endif % if selected_groups_label:

${selected_groups_label}