${_("Loading")}
+diff --git a/edx-platform/bragi/cms/templates/container.html b/edx-platform/bragi/cms/templates/container.html new file mode 100644 index 00000000..ffafa8d9 --- /dev/null +++ b/edx-platform/bragi/cms/templates/container.html @@ -0,0 +1,234 @@ +<%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.utils.translation import gettext as _ + +from cms.djangoapps.contentstore.views.helpers import xblock_studio_url, xblock_type_display_name +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}" + } + ); + require(["js/models/xblock_info", "js/views/xblock", "js/views/utils/xblock_utils", "common/js/components/utils/view_utils"], function (XBlockInfo, XBlockView, XBlockUtils, ViewUtils) { + 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}' + }); + xblockView.xblockReady = function() { + $('.seq_new_button').click(function(evt) { + evt.preventDefault(); + XBlockUtils.addXBlock($(evt.target)).done(function(locator) { + ViewUtils.redirect('/container/' + locator + '?action=new'); + return false; + }); + return false; + }); + + }; + xblockView.render(); + }); + %static:webpack> +%block> + +<%block name="content"> + + + + +
${_("Loading")}
+