h3 { font-size: 120%; }
h1 { color: navy; }
-h2 { color: #066; }
+h2 { color: #338; }
h3, h4 { color: darkgreen; }
h1 a, h2 a { color: navy; }
#coursebanner h1 { padding: 0; font-size: 110%; }
-#edit_course_link { float: right; margin: 4 0 0 0; font-size: 95%; }
+#edit_course_link { margin: 8 0 8 0; font-size: 95%; }
.breadcrumbs { margin: 8 8 8 0; }
(r'^department/(?P<department_id>.*)/$', 'department_detail'),
(r'^course/(?P<course_id>\d+)/search/$', 'course_search'),
(r'^course/(?P<course_id>\d+)/edit/$', 'edit_course'),
+ (r'^course/(?P<course_id>\d+)/edit/delete/$', 'delete_course'),
(r'^course/(?P<course_id>\d+)/edit/permission/$', 'edit_course_permissions'),
(ITEM_PREFIX + r'$', 'item_detail'),
(ITEM_PREFIX + r'dl/(?P<filename>.*)$', 'item_download'),
if course.access == u'STUDT':
raise NotImplementedError, 'No course sections yet! Coming soon.'
return HttpResponseRedirect('.')
-
+
+@login_required # fixme, must be instructor...
+def delete_course(request, course_id):
+ course = get_object_or_404(models.Course, pk=course_id)
+ if request.POST.get('confirm_delete'):
+ course.delete()
+ return HttpResponseRedirect('/syrup/course/')
+ else:
+ return HttpResponseRedirect('../')
+
#------------------------------------------------------------
@login_required # must be, to avoid/audit brute force attacks.
</table>
<p><input type="submit" value="Continue"/></p>
</form>
-
<div class="gap"/>
+ <div py:if="instance.id">
+ <h2>Delete this course</h2>
+ <form action="delete/" method="POST">
+ <p><input type="checkbox" name="confirm_delete" id="confirm_delete"/>
+ <label for="confirm_delete">Yes, I want to delete this course site and all of its contents.</label>
+ </p>
+ <p><input type="submit" value="Delete this course"/></p>
+ </form>
+ </div>
</body>
</html>