Files
edx-platform/cms/templates/widgets/units.html
Chris Dodge 322c4c0ba6 Merge branch 'feature/cale/cms-master' of github.com:MITx/mitx into feature/cdodge/subsection-edit-page
Conflicts:
	cms/djangoapps/contentstore/views.py
	cms/templates/widgets/units.html
2012-10-04 11:03:37 -04:00

41 lines
1.2 KiB
HTML

<%! from django.core.urlresolvers import reverse %>
<!--
This def will enumerate through a passed in subsection and list all of the units
-->
<%def name="enum_units(subsection, actions=True, selected=None)">
<ol>
% for unit in subsection.get_children():
<li class="leaf unit" data-id="${unit.location}">
<%
if unit.location == selected:
selected_class = 'editing'
else:
selected_class = ''
%>
<div class="section-item ${selected_class}">
<a href="${reverse('edit_unit', args=[unit.location])}" class="private-item">
<span class="${unit.category}-icon"></span>
${unit.display_name}
<span class="private-tag">- private</span>
</a>
% if actions:
<div class="item-actions">
<a href="#" class="delete-button" data-id="${unit.location}"><span class="delete-icon"></span></a>
<a href="#" class="drag-handle wip"></a>
</div>
% endif
</div>
</li>
% endfor
<li>
<a href="#" class="new-unit-item wip" data-template="${create_new_unit_template}" data-parent="${subsection.location}">
<span class="new-unit-icon"></span>New Unit
</a>
</li>
</ol>
</%def>