container.html 5.57 KB
Newer Older
1 2 3 4
<%inherit file="base.html" />
<%!
import json

5
from contentstore.utils import PublishState
6
from contentstore.views.helpers import xblock_studio_url, EDITING_TEMPLATES
7 8 9 10 11 12 13 14 15
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" />


16
<%block name="header_extras">
17
% for template_name in EDITING_TEMPLATES:
18 19 20 21 22 23
<script type="text/template" id="${template_name}-tpl">
    <%static:include path="js/${template_name}.underscore" />
</script>
% endfor
</%block>

24 25
<%block name="jsextra">
<%
26
main_xblock_info = {
27
    'id': str(xblock_locator),
28
    'display_name': xblock.display_name_with_default,
29 30 31 32
    'category': xblock.category,
};
%>
<script type='text/javascript'>
33
    require(["domReady!", "jquery", "js/models/xblock_info", "js/views/pages/container",
34 35
        "js/collections/component_template", "xmodule", "coffee/src/main", "xblock/cms.runtime.v1"],
            function(doc, $, XBlockInfo, ContainerPage, ComponentTemplates) {
36 37
                var view, mainXBlockInfo;

38 39
                var templates = new ComponentTemplates(${component_templates | n}, {parse: true});

40 41
                mainXBlockInfo = new XBlockInfo(${json.dumps(main_xblock_info) | n});

42
                view = new ContainerPage({
43
                    el: $('#content'),
44 45
                    model: mainXBlockInfo,
                    templates: templates
46 47 48 49 50 51 52 53 54 55
                });
                view.render();
            });
</script>

</%block>

<%block name="content">


56
<div class="wrapper-mast wrapper" data-location="" data-display-name="" data-category="">
57 58 59
    <header class="mast has-actions has-navigation">
        <h1 class="page-header">
            <small class="navigation navigation-parents">
cahrens committed
60
                % for ancestor in ancestor_xblocks:
61
                    <%
cahrens committed
62
                    ancestor_url = xblock_studio_url(ancestor, context_course)
63
                    %>
cahrens committed
64 65 66
                    % if ancestor_url:
                    <a href="${ancestor_url}"
                       class="navigation-link navigation-parent">${ancestor.display_name_with_default | h}</a>
67 68
                    % endif
                % endfor
69
                <a href="#" class="navigation-link navigation-current">${xblock.display_name_with_default | h}</a>
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
            </small>
        </h1>

        <nav class="nav-actions">
            <h3 class="sr">${_("Page Actions")}</h3>
            <ul>
            </ul>
        </nav>
    </header>
</div>

<div class="wrapper-content wrapper">
    <div class="inner-wrapper">
        <section class="content-area">

            <article class="content-primary window">
86
                <section class="wrapper-xblock level-page is-hidden studio-xblock-wrapper" data-locator="${xblock_locator}">
87 88 89 90 91 92 93
                </section>
                <div class="no-container-content is-hidden">
                    <p>${_("This page has no content yet.")}</p>
                </div>
                <div class="ui-loading">
                    <p><span class="spin"><i class="icon-refresh"></i></span> <span class="copy">${_("Loading...")}</span></p>
                </div>
94 95
            </article>
            <aside class="content-supplementary" role="complimentary">
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
                % if unit:
                  % if unit_publish_state == PublishState.public:
                    <div class="bit-publishing published">
                      <h3 class="title pub-status"><span class="sr">${_("Publishing Status")} </span>${_("Published")}</h3>
                      <p class="copy">
                          <%
                          unit_link=u'<a href="{unit_address}">{unit_display_name}</a>'.format(
                              unit_address=xblock_studio_url(unit),
                              unit_display_name=unit.display_name_with_default,
                          )
                          %>
                          ${_('To make changes to the content of this page, you need to edit unit {unit_link} as a draft.'
                                  ).format(unit_link=unit_link)}
                      </p>
                    </div>
                  % else:
                    <div class="bit-publishing draft">
                        <h3 class="title pub-status"><span class="sr">${_("Publishing Status")} </span>${_("Draft")}</h3>
                        <p class="copy">
                            <%
                            unit_link=u'<a href="{unit_address}">{unit_display_name}</a>'.format(
                                unit_address=xblock_studio_url(unit),
                                unit_display_name=unit.display_name_with_default,
                            )
                            %>
                            ${_('You can edit the content of this page, and your changes will be published with unit {unit_link}.').format(unit_link=unit_link)}
                        </p>
                    </div>
                  % endif
                % endif
126 127 128
                <div class="bit">
                    <h3 class="title-3">${_("What can I do on this page?")}</h3>
                    <ul class="list-details">
129
                        <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>
130 131 132 133 134 135 136
                    </ul>
                </div>
            </aside>
        </section>
    </div>
</div>
</%block>