Conflicts: cms/djangoapps/contentstore/tests/test_contentstore.py cms/djangoapps/contentstore/views/component.py cms/djangoapps/contentstore/views/item.py cms/djangoapps/contentstore/views/preview.py cms/djangoapps/contentstore/views/tests/test_container.py cms/static/js/spec/views/unit_spec.js cms/static/js/utils/module.js cms/templates/container.html cms/templates/studio_vertical_wrapper.html cms/templates/studio_xblock_wrapper.html common/djangoapps/student/views.py lms/templates/notes.html lms/templates/textannotation.html lms/templates/videoannotation.html
56 lines
2.1 KiB
HTML
56 lines
2.1 KiB
HTML
<%! from django.utils.translation import ugettext as _ %>
|
|
<%! from contentstore.utils import compute_publish_state, reverse_usage_url %>
|
|
|
|
<!--
|
|
This def will enumerate through a passed in subsection and list all of the units
|
|
-->
|
|
<%def name="enum_units(subsection, actions=True, selected=None, sortable=True, subsection_units=None)">
|
|
<ol ${'class="sortable-unit-list"' if sortable else ''}>
|
|
<%
|
|
if subsection_units is None:
|
|
subsection_units = subsection.get_children()
|
|
%>
|
|
% for unit in subsection_units:
|
|
<li class="courseware-unit unit is-draggable" data-locator="${unit.location}"
|
|
data-parent="${subsection.location}" data-course-key="${unit.location.course_key}">
|
|
|
|
<%include file="_ui-dnd-indicator-before.html" />
|
|
|
|
<%
|
|
unit_state = compute_publish_state(unit)
|
|
if unit.location == selected:
|
|
selected_class = 'editing'
|
|
else:
|
|
selected_class = ''
|
|
%>
|
|
<div class="section-item ${selected_class}">
|
|
<a href="${reverse_usage_url('unit_handler', unit.location)}" class="${unit_state}-item">
|
|
<span class="unit-name">${unit.display_name_with_default}</span>
|
|
</a>
|
|
% if actions:
|
|
<div class="item-actions">
|
|
<ul class="actions-list">
|
|
<li class="actions-item delete">
|
|
<a href="#" data-tooltip="${_("Delete this unit")}" class="delete-unit-button action" data-locator="${unit.location}"><i class="icon-trash"></i><span class="sr">${_("Delete unit")}</span></a>
|
|
</li>
|
|
<li class="actions-item drag">
|
|
<span data-tooltip="${_("Drag to sort")}" class="drag-handle unit-drag-handle"><span class="sr"> ${_("Drag to reorder unit")}</span></span>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
% endif
|
|
</div>
|
|
|
|
<%include file="_ui-dnd-indicator-after.html" />
|
|
</li>
|
|
% endfor
|
|
<li class="courseware-unit add-new-unit">
|
|
<%include file="_ui-dnd-indicator-initial.html" />
|
|
|
|
<a href="#" class="new-unit-item" data-category="${new_unit_category}" data-parent="${subsection.location}">
|
|
<i class="icon-plus"></i> ${_("New Unit")}
|
|
</a>
|
|
</li>
|
|
</ol>
|
|
</%def>
|