Change delete_item to RESTful URL.

Part of STUD-847.
This commit is contained in:
cahrens
2013-11-01 14:39:23 -04:00
parent b489514096
commit 16766a5ee9
21 changed files with 172 additions and 106 deletions

View File

@@ -1,5 +1,6 @@
<%! from django.core.urlresolvers import reverse %>
<%! from contentstore.utils import compute_unit_state %>
<%! from xmodule.modulestore.django import loc_mapper %>
<!--
This def will enumerate through a passed in subsection and list all of the units
@@ -11,7 +12,11 @@ This def will enumerate through a passed in subsection and list all of the units
subsection_units = subsection.get_children()
%>
% for unit in subsection_units:
<li class="courseware-unit leaf unit is-draggable" data-id="${unit.location}" data-parent-id="${subsection.location.url()}">
<%
unit_update_url = loc_mapper().translate_location(context_course.location.course_id, unit.location, False, True).url_reverse('xblock')
%>
<li class="courseware-unit leaf unit is-draggable" data-id="${unit.location}" data-parent-id="${subsection.location.url()}"
data-update_url="${unit_update_url}" >
<%include file="_ui-dnd-indicator-before.html" />
@@ -29,7 +34,9 @@ This def will enumerate through a passed in subsection and list all of the units
</a>
% if actions:
<div class="item-actions">
<a href="#" data-tooltip="Delete this unit" class="delete-button" data-id="${unit.location}"><span class="delete-icon"></span></a>
<a href="#" data-tooltip="Delete this unit" class="delete-button" data-id="${unit.location}"
data-update_url="${unit_update_url}">
<span class="delete-icon"></span></a>
<span data-tooltip="Drag to sort" class="drag-handle unit-drag-handle"></span>
</div>
% endif