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" +%> + +<%! +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 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}" + } + ); + 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(); + }); + + + +<%block name="content"> + + + + +
+
+
+ + +
+

${xblock.display_name_with_default}

+
+
+
+
+ + + % if is_unit_page: +
+ % endif +
+
+ +
+
+
+ +
+
+ +
+

${_("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.name | 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}" + } + +
+
+
+