<%page expression_filter="h"/> <%inherit file="base.html" /> <%def name="online_help_token()"> <% if is_unit_page: return "unit" else: return "container" %> <%! from django.urls import reverse from django.utils.translation import gettext as _ from cms.djangoapps.contentstore.helpers import xblock_studio_url, xblock_type_display_name from cms.djangoapps.contentstore.toggles import use_new_text_editor, use_new_problem_editor, use_new_video_editor, use_video_gallery_flow from cms.djangoapps.contentstore.utils import get_editor_page_base_url from openedx.core.djangolib.js_utils import ( dump_js_escaped_json, js_escaped_string ) from openedx.core.djangolib.markup import HTML, Text %> <%block name="title">${xblock.display_name_with_default} ${xblock_type_display_name(xblock)} <%block name="bodyclass">is-signedin course container view-container <%namespace name='static' file='static_content.html'/> <%block name="header_extras"> % for template_name in templates: % endfor % if not settings.STUDIO_FRONTEND_CONTAINER_URL: % endif <%block name="page_bundle"> <%static:webpack entry="js/factories/container"> ContainerFactory( ${component_templates | n, dump_js_escaped_json}, ${xblock_info | n, dump_js_escaped_json}, "${action | n, js_escaped_string}", { isUnitPage: ${is_unit_page | n, dump_js_escaped_json}, canEdit: true, outlineURL: "${outline_url | n, js_escaped_string}", libraryContentPickerUrl: "${library_content_picker_url | n, js_escaped_string}", clipboardData: ${user_clipboard | n, dump_js_escaped_json}, } ); require(["js/models/xblock_info", "js/views/xblock", "js/views/utils/xblock_utils", "common/js/components/utils/view_utils", "gettext"], function (XBlockInfo, XBlockView, XBlockUtils, ViewUtils, gettext) { var model = new XBlockInfo({ id: '${subsection.location|n, decode.utf8}' }); var xblockView = new XBlockView({ model: model, el: $('#sequence-nav'), view: 'author_view?position=${position|n, decode.utf8}&next_url=${next_url|n, decode.utf8}&prev_url=${prev_url|n, decode.utf8}', clipboardData: ${user_clipboard | n, dump_js_escaped_json}, }); xblockView.xblockReady = function() { var toggleCaretButton = function(clipboardData) { if (clipboardData && clipboardData.content && clipboardData.source_usage_key.includes("vertical")) { $('.dropdown-toggle-button').show(); } else { $('.dropdown-toggle-button').hide(); $('.dropdown-options').hide(); } }; this.clipboardBroadcastChannel = new BroadcastChannel("studio_clipboard_channel"); this.clipboardBroadcastChannel.onmessage = (event) => { toggleCaretButton(event.data); }; toggleCaretButton(this.options.clipboardData); $('#new-unit-button').on('click', function(event) { event.preventDefault(); XBlockUtils.addXBlock($(this)).done(function(locator) { ViewUtils.redirect('/container/' + locator + '?action=new'); }); }); $('.custom-dropdown .dropdown-toggle-button').on('click', function(event) { event.stopPropagation(); // Prevent the event from closing immediately when we open it $(this).next('.dropdown-options').slideToggle('fast'); // This toggles the dropdown visibility var isExpanded = $(this).attr('aria-expanded') === 'true'; $(this).attr('aria-expanded', !isExpanded); }); $('.seq_paste_unit').on('click', function(event) { event.preventDefault(); $('.dropdown-options').hide(); XBlockUtils.pasteXBlock($(this)).done(function(data) { ViewUtils.redirect('/container/' + data.locator + '?action=new'); }); }); }; xblockView.render(); }); <%block name="content"> <% use_new_editor_text = use_new_text_editor() use_new_editor_video = use_new_video_editor() use_new_editor_problem = use_new_problem_editor() use_new_video_gallery_flow = use_video_gallery_flow() %>

${xblock.display_name_with_default}

% if is_unit_page:
% endif
<% assets_url = reverse('assets_handler', kwargs={'course_key_string': str(xblock_locator.course_key)}) %>

${_("Loading")}

<%static:studiofrontend entry="editImageModal"> { "course": { "id": "${context_course.id | n, js_escaped_string}", "name": "${context_course.display_name_with_default | n, js_escaped_string}", "url_name": "${context_course.location.block_id | n, js_escaped_string}", "org": "${context_course.location.org | n, js_escaped_string}", "num": "${context_course.location.course | n, js_escaped_string}", "display_course_number": "${context_course.display_coursenumber | n, js_escaped_string}", "revision": "${context_course.location.revision | n, js_escaped_string}" }, "help_tokens": { "image_accessibility": "${get_online_help_info('image_accessibility')['doc_url'] | n, js_escaped_string}" }, "lang": "${language_code | n, js_escaped_string}" }