Files
edx-platform/cms/templates/container.html
Andy Armstrong fcc0231d4d Add new container page that can display nested xblocks
This is the changes for STUD-1244, which introduces the ability for Studio to display
arbitrarily nested xblocks. In this change, a new container page is introduced which can
display nested xblocks. In particular, the xblock type of 'vertical' is special cased
to be shown inline as a collapsible section. The unit page is mostly unchanged, except
that container xblock's are shown as a link to their container page, rather than being
shown inline.
2014-02-27 14:53:05 -05:00

92 lines
3.0 KiB
HTML

<%inherit file="base.html" />
<%!
import json
from contentstore.views.helpers import xblock_studio_url
from django.utils.translation import ugettext as _
%>
<%block name="title">${_("Container")}</%block>
<%block name="bodyclass">is-signedin course container view-container</%block>
<%namespace name='static' file='static_content.html'/>
<%namespace name="units" file="widgets/units.html" />
<%block name="jsextra">
<%
xblock_info = {
'id': str(xblock_locator),
'display-name': xblock.display_name,
'category': xblock.category,
};
%>
<script type='text/javascript'>
require(["domReady!", "jquery", "js/models/xblock_info", "js/views/xblock",
"js/models/module_info", "coffee/src/views/unit",
"xmodule", "coffee/src/main", "xblock/cms.runtime.v1",
"js/views/metadata", "js/collections/metadata"],
function(doc, $, XBlockInfo, XBlockView) {
var model,
view;
model = new XBlockInfo(${json.dumps(xblock_info) | n});
view = new XBlockView({
el: $('.wrapper-xblock.level-page').first(),
model: model,
view: 'container_preview'
});
view.render();
});
</script>
</%block>
<%block name="content">
<div class="wrapper-mast wrapper">
<header class="mast has-actions has-navigation">
<h1 class="page-header">
<small class="navigation navigation-parents">
<%
parent_url = xblock_studio_url(parent_xblock, context_course)
%>
% if parent_url:
<a href="${parent_url}"
class="navigation-link navigation-parent">${parent_xblock.display_name | h}</a>
% endif
<a href="#" class="navigation-link navigation-current">${xblock.display_name | h}</a>
</small>
</h1>
<nav class="nav-actions">
<h3 class="sr">${_("Page Actions")}</h3>
<ul>
<li class="sr nav-item">
${_("No Actions")}
</li>
</ul>
</nav>
</header>
</div>
<div class="wrapper-content wrapper">
<div class="inner-wrapper">
<section class="content-area">
<article class="content-primary window">
<section class="wrapper-xblock level-page" data-locator="${xblock_locator}"/>
</article>
<aside class="content-supplementary" role="complimentary">
<div class="bit">
<h3 class="title-3">${_("What can I do on this page?")}</h3>
<ul class="list-details">
<li class="item-detail">${_("You can view course components that contain other components on this page. In the case of experiment blocks, this allows you to confirm that you have properly configured your experiment groups.")}</li>
</ul>
</div>
</aside>
</section>
</div>
</div>
</%block>