Commit 3bb4be7d by Andy Armstrong Committed by cahrens

Add publishing sidebar to container page

parent b59d7ba9
...@@ -312,8 +312,10 @@ def container_handler(request, tag=None, package_id=None, branch=None, version_g ...@@ -312,8 +312,10 @@ def container_handler(request, tag=None, package_id=None, branch=None, version_g
ancestor_xblocks = [] ancestor_xblocks = []
parent = get_parent_xblock(xblock) parent = get_parent_xblock(xblock)
unit = None
while parent and parent.category != 'sequential': while parent and parent.category != 'sequential':
ancestor_xblocks.append(parent) ancestor_xblocks.append(parent)
unit = parent
parent = get_parent_xblock(parent) parent = get_parent_xblock(parent)
ancestor_xblocks.reverse() ancestor_xblocks.reverse()
...@@ -322,6 +324,7 @@ def container_handler(request, tag=None, package_id=None, branch=None, version_g ...@@ -322,6 +324,7 @@ def container_handler(request, tag=None, package_id=None, branch=None, version_g
'context_course': course, 'context_course': course,
'xblock': xblock, 'xblock': xblock,
'xblock_locator': locator, 'xblock_locator': locator,
'unit': unit,
'ancestor_xblocks': ancestor_xblocks, 'ancestor_xblocks': ancestor_xblocks,
}) })
else: else:
......
...@@ -79,6 +79,15 @@ xblock_info = { ...@@ -79,6 +79,15 @@ xblock_info = {
<section class="wrapper-xblock level-page" data-locator="${xblock_locator}"/> <section class="wrapper-xblock level-page" data-locator="${xblock_locator}"/>
</article> </article>
<aside class="content-supplementary" role="complimentary"> <aside class="content-supplementary" role="complimentary">
<div class="bit-publishing">
<h3 class="title-3">${_("Publishing Status")}</h3>
<p class="copy">${_('This container will publish as part of the unit {unit_link}.').format(
unit_link=u'<a href="{unit_address}">{unit_name}</a>'.format(
unit_address=xblock_studio_url(unit),
unit_name=unit.display_name_with_default,
)
)}</p>
</div>
<div class="bit"> <div class="bit">
<h3 class="title-3">${_("What can I do on this page?")}</h3> <h3 class="title-3">${_("What can I do on this page?")}</h3>
<ul class="list-details"> <ul class="list-details">
......
<%! from django.utils.translation import ugettext as _ %> <%! from django.utils.translation import ugettext as _ %>
<%! from django.core.urlresolvers import reverse %> <%! from django.core.urlresolvers import reverse %>
<%! from contentstore.utils import compute_unit_state %> <%! from contentstore.utils import compute_publish_state %>
<%! from xmodule.modulestore.django import loc_mapper %> <%! from xmodule.modulestore.django import loc_mapper %>
<!-- <!--
...@@ -25,7 +25,7 @@ This def will enumerate through a passed in subsection and list all of the units ...@@ -25,7 +25,7 @@ This def will enumerate through a passed in subsection and list all of the units
<%include file="_ui-dnd-indicator-before.html" /> <%include file="_ui-dnd-indicator-before.html" />
<% <%
unit_state = compute_unit_state(unit) unit_state = compute_publish_state(unit)
if unit.location == selected: if unit.location == selected:
selected_class = 'editing' selected_class = 'editing'
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment