${_("Loading")}
%page expression_filter="h"/> <%inherit file="base.html" /> <%def name="online_help_token()"> <% if is_unit_page: return "unit" else: return "container" %> %def> <%! 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> <%block name="bodyclass">is-signedin course container view-container%block> <%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> <%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(); }); %static:webpack> %block> <%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() %>
${_("Loading")}