diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index f40fad42152c..ce4eee624091 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -547,6 +547,17 @@ def get_taxonomy_list_url() -> str | None: return f'{mfe_base_url}/taxonomies' +def get_libraries_list_url() -> str | None: + """ + Gets course authoring microfrontend URL for libraries list view. + """ + mfe_base_url = settings.COURSE_AUTHORING_MICROFRONTEND_URL + if not mfe_base_url: + return None + + return f'{mfe_base_url}/libraries' + + def get_taxonomy_tags_widget_url(course_locator=None) -> str | None: """ Gets course authoring microfrontend URL for taxonomy tags drawer widget view. diff --git a/cms/static/sass/elements/_modal-window.scss b/cms/static/sass/elements/_modal-window.scss index 7ff4223cd3d8..7ac046a89aa8 100644 --- a/cms/static/sass/elements/_modal-window.scss +++ b/cms/static/sass/elements/_modal-window.scss @@ -28,7 +28,7 @@ padding: 5%; } - .title { + .title:not(.deprecated-title) { @extend %t-title5; @extend %t-demi-strong; diff --git a/cms/templates/library-block-author-preview-header.html b/cms/templates/library-block-author-preview-header.html index c6ebb4e6214c..f32498053ccf 100644 --- a/cms/templates/library-block-author-preview-header.html +++ b/cms/templates/library-block-author-preview-header.html @@ -1,6 +1,34 @@ <%page expression_filter="h"/> -<%! from django.utils.translation import ngettext %> +<%! +from django.utils.translation import ngettext, gettext as _ +from cms.djangoapps.contentstore.utils import get_libraries_list_url + +libraries_list_url = get_libraries_list_url() +%>
+

diff --git a/cms/templates/library.html b/cms/templates/library.html index 57d0363dad9e..0e16beec2881 100644 --- a/cms/templates/library.html +++ b/cms/templates/library.html @@ -5,6 +5,7 @@ <%! from cms.djangoapps.contentstore.helpers import xblock_studio_url, xblock_type_display_name +from cms.djangoapps.contentstore.utils import get_libraries_list_url from django.utils.translation import gettext as _ from openedx.core.djangolib.js_utils import dump_js_escaped_json from openedx.core.djangolib.markup import HTML, Text @@ -41,7 +42,7 @@ <%block name="content"> - +<% libraries_list_url = get_libraries_list_url() %>

@@ -77,6 +78,29 @@

${_("Page Actions")}

+
diff --git a/cms/templates/widgets/metadata-edit.html b/cms/templates/widgets/metadata-edit.html index c70d9bd9c8dd..70d950653d53 100644 --- a/cms/templates/widgets/metadata-edit.html +++ b/cms/templates/widgets/metadata-edit.html @@ -36,4 +36,32 @@ <%include file="source-edit.html" /> % endif +## It is used to display a warning if a block (i.e. a LibraryContentBlock) uses the deprecated +## legacy libraries feature. +% if show_deprecated_warning: + +% endif + diff --git a/xmodule/library_content_block.py b/xmodule/library_content_block.py index 6f583d8beff2..801533885bce 100644 --- a/xmodule/library_content_block.py +++ b/xmodule/library_content_block.py @@ -142,6 +142,20 @@ def is_ready_to_migrate_to_v2(self) -> bool: """ return self.is_source_lib_migrated_to_v2 and not self.is_migrated_to_v2 + def get_context(self): + """ + Extend context adding `show_deprecated_warning` flag + """ + from cms.djangoapps.contentstore.utils import get_libraries_list_url + + library_url = get_libraries_list_url() + + context = super().get_context() + context["show_deprecated_warning"] = True + context["library_url"] = library_url + + return context + def author_view(self, context): """ Renders the Studio views.