add subsection edit page to the project with a shared 'unit' widget that will render out unit lists. Both edit_subsection and overview.html will share this widget
This commit is contained in:
@@ -144,7 +144,8 @@ def edit_subsection(request, location):
|
||||
if item.location.category != 'sequential':
|
||||
return HttpResponseBadRequest
|
||||
|
||||
return render_to_response('edit_subsection.html', {})
|
||||
return render_to_response('edit_subsection.html',
|
||||
{'subsection':item})
|
||||
|
||||
@login_required
|
||||
def edit_unit(request, location):
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
<%block name="bodyclass">subsection</%block>
|
||||
<%block name="title">CMS Subsection</%block>
|
||||
<%block name="content">
|
||||
|
||||
<%namespace name="units" file="widgets/units.html" />
|
||||
|
||||
<%block name="content">
|
||||
<div class="main-wrapper">
|
||||
<div class="inner-wrapper">
|
||||
<div class="main-column">
|
||||
@@ -18,63 +20,7 @@
|
||||
</div>
|
||||
<div class="unit-list">
|
||||
<label>Units:</label>
|
||||
<ol>
|
||||
<li class="leaf">
|
||||
<div class="section-item">
|
||||
<a href="unit.html"><span class="video-icon"></span>Motivation for 6.002x</a>
|
||||
<div class="item-actions">
|
||||
<a href="#" class="edit-button"><span class="delete-icon"></span></a>
|
||||
<a href="#" class="visibility-toggle"><span class="toggle-icon"></span></a>
|
||||
<a href="#" class="drag-handle"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="leaf">
|
||||
<div class="section-item">
|
||||
<a href="unit.html"><span class="video-icon"></span>Administrivia</a>
|
||||
<div class="item-actions">
|
||||
<a href="#" class="edit-button"><span class="delete-icon"></span></a>
|
||||
<a href="#" class="visibility-toggle"><span class="toggle-icon"></span></a>
|
||||
<a href="#" class="drag-handle"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="leaf">
|
||||
<div class="section-item">
|
||||
<a href="unit.html"><span class="video-icon"></span>Course Overview</a>
|
||||
<div class="item-actions">
|
||||
<a href="#" class="edit-button"><span class="delete-icon"></span></a>
|
||||
<a href="#" class="visibility-toggle"><span class="toggle-icon"></span></a>
|
||||
<a href="#" class="drag-handle"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="leaf">
|
||||
<div class="section-item">
|
||||
<a href="unit.html"><span class="video-icon"></span>Lumped Element Abstraction</a>
|
||||
<div class="item-actions">
|
||||
<a href="#" class="edit-button"><span class="delete-icon"></span></a>
|
||||
<a href="#" class="visibility-toggle"><span class="toggle-icon"></span></a>
|
||||
<a href="#" class="drag-handle"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="leaf">
|
||||
<div class="section-item">
|
||||
<a href="unit.html"><span class="video-icon"></span>Simple Power</a>
|
||||
<div class="item-actions">
|
||||
<a href="#" class="edit-button"><span class="delete-icon"></span></a>
|
||||
<a href="#" class="visibility-toggle"><span class="toggle-icon"></span></a>
|
||||
<a href="#" class="drag-handle"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="unit.html" class="new-unit-item">
|
||||
<span class="new-unit-icon"></span>New Unit
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
${units.enum_units(subsection)}
|
||||
</div>
|
||||
<div>
|
||||
<label>Policy:</label>
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
<%! from django.core.urlresolvers import reverse %>
|
||||
<%block name="title">CMS Courseware Overview</%block>
|
||||
|
||||
<%namespace name="units" file="widgets/units.html" />
|
||||
|
||||
|
||||
<%block name="content">
|
||||
<div class="main-wrapper">
|
||||
<div class="inner-wrapper">
|
||||
@@ -44,27 +47,7 @@
|
||||
<a href="#" class="drag-handle wip"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ol>
|
||||
% for unit in subsection.get_children():
|
||||
<li class="leaf">
|
||||
<div class="section-item">
|
||||
<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>
|
||||
<div class="item-actions">
|
||||
<a href="${reverse('delete_unit', args=[unit.location])}" class="edit-button wip"><span class="delete-icon"></span></a>
|
||||
<a href="#" class="drag-handle wip"></a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
% endfor
|
||||
<li>
|
||||
<a href="#" class="new-unit-item wip">
|
||||
<span class="new-unit-icon"></span>New Unit
|
||||
</a>
|
||||
</li>
|
||||
</ol>
|
||||
${units.enum_units(subsection)}
|
||||
</li>
|
||||
% endfor
|
||||
</ol>
|
||||
|
||||
Reference in New Issue
Block a user