157 lines
6.7 KiB
HTML
157 lines
6.7 KiB
HTML
<%inherit file="base.html" />
|
|
<%def name="online_help_token()">
|
|
<%
|
|
if is_unit_page:
|
|
return "unit"
|
|
else:
|
|
return "container"
|
|
%>
|
|
</%def>
|
|
<%!
|
|
import json
|
|
|
|
from xmodule.modulestore import PublishState
|
|
from contentstore.views.helpers import xblock_studio_url, xblock_type_display_name, EDITING_TEMPLATES
|
|
from django.utils.translation import ugettext as _
|
|
%>
|
|
<%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'/>
|
|
<%namespace name="units" file="widgets/units.html" />
|
|
|
|
|
|
<%block name="header_extras">
|
|
% for template_name in EDITING_TEMPLATES:
|
|
<script type="text/template" id="${template_name}-tpl">
|
|
<%static:include path="js/${template_name}.underscore" />
|
|
</script>
|
|
% endfor
|
|
</%block>
|
|
|
|
<%block name="jsextra">
|
|
<link rel="stylesheet" type="text/css" href="${static.url('js/vendor/timepicker/jquery.timepicker.css')}" />
|
|
<%
|
|
main_xblock_info = {
|
|
'id': str(xblock_locator),
|
|
'display_name': xblock.display_name_with_default,
|
|
'category': xblock.category,
|
|
};
|
|
%>
|
|
<script type='text/javascript'>
|
|
require(["domReady!", "jquery", "js/models/xblock_info", "js/views/pages/container",
|
|
"js/collections/component_template", "xmodule", "coffee/src/main", "xblock/cms.runtime.v1"],
|
|
function(doc, $, XBlockInfo, ContainerPage, ComponentTemplates, xmoduleLoader) {
|
|
var templates = new ComponentTemplates(${component_templates | n}, {parse: true});
|
|
var mainXBlockInfo = new XBlockInfo(${json.dumps(main_xblock_info) | n});
|
|
|
|
xmoduleLoader.done(function () {
|
|
var view = new ContainerPage({
|
|
el: $('#content'),
|
|
model: mainXBlockInfo,
|
|
templates: templates
|
|
});
|
|
view.render();
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</%block>
|
|
|
|
<%block name="content">
|
|
|
|
|
|
<div class="wrapper-mast wrapper">
|
|
<header class="mast has-actions has-navigation has-subtitle">
|
|
<div class="page-header">
|
|
<small class="navigation navigation-parents subtitle">
|
|
% for ancestor in ancestor_xblocks:
|
|
<%
|
|
ancestor_url = xblock_studio_url(ancestor)
|
|
%>
|
|
% if ancestor_url:
|
|
<a href="${ancestor_url}" class="navigation-item navigation-link navigation-parent">
|
|
${ancestor.display_name_with_default | h}
|
|
</a>
|
|
% else:
|
|
<span class="navigation-item navigation-parent">${ancestor.display_name_with_default | h}</span>
|
|
% endif
|
|
% endfor
|
|
</small>
|
|
<div class="wrapper-xblock-field" data-field="display_name">
|
|
<h1 class="page-header-title is-editable xblock-field-value">${xblock.display_name_with_default | h}</h1>
|
|
</div>
|
|
</div>
|
|
|
|
<nav class="nav-actions">
|
|
<h3 class="sr">${_("Page Actions")}</h3>
|
|
<ul>
|
|
% if not is_unit_page and not unit_publish_state == 'public':
|
|
<li class="action-item action-edit nav-item">
|
|
<a href="#" class="button edit-button action-button">
|
|
<i class="icon-pencil"></i>
|
|
<span class="action-button-text">${_("Edit")}</span>
|
|
</a>
|
|
</li>
|
|
% endif
|
|
</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 is-hidden studio-xblock-wrapper" data-locator="${xblock_locator}" data-course-key="${xblock_locator.course_key}">
|
|
</section>
|
|
<div class="ui-loading">
|
|
<p><span class="spin"><i class="icon-refresh"></i></span> <span class="copy">${_("Loading...")}</span></p>
|
|
</div>
|
|
</article>
|
|
<aside class="content-supplementary" role="complimentary">
|
|
% if not is_unit_page:
|
|
<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 and edit 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 and make changes to existing content.")}</li>
|
|
</ul>
|
|
</div>
|
|
% endif
|
|
% if is_unit_page:
|
|
<div class="unit-location">
|
|
<h4 class="header">${_("Unit Location")}</h4>
|
|
<div class="wrapper-unit-id content-bit">
|
|
<h5 class="title">Unit Location ID</h5>
|
|
<p class="unit-id">
|
|
<span class="unit-id-value" id="unit-location-id-input">${unit.location.name}</span>
|
|
<span class="tip"><span class="sr">Tip: </span>${_("Use this ID to link to this unit from other places in your course")}</span>
|
|
</p>
|
|
</div>
|
|
<div class="wrapper-unit-tree-location content-bit">
|
|
<h5 class="title">Unit Tree Location</h5>
|
|
<ol>
|
|
<li class="section">
|
|
<a href="${xblock_studio_url(section)}" class="section-item section-name">
|
|
<span class="section-name">${section.display_name_with_default}</span>
|
|
</a>
|
|
<ol>
|
|
<li class="subsection">
|
|
<div class="section-item">
|
|
<span class="subsection-name"><span class="subsection-name-value">${subsection.display_name_with_default}</span></span>
|
|
</div>
|
|
${units.enum_units(subsection, actions=False, selected=unit.location)}
|
|
</li>
|
|
</ol>
|
|
</li>
|
|
</ol>
|
|
</div>
|
|
</div>
|
|
% endif
|
|
</aside>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
</%block>
|