[open-ils-commits] r149 - in servres/trunk/conifer: static syrup templates (gfawcett)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Mar 8 15:28:53 EDT 2009
Author: gfawcett
Date: 2009-03-08 15:28:49 -0400 (Sun, 08 Mar 2009)
New Revision: 149
Modified:
servres/trunk/conifer/static/main.css
servres/trunk/conifer/syrup/urls.py
servres/trunk/conifer/syrup/views.py
servres/trunk/conifer/templates/add_new_course.xhtml
Log:
added course-site deletion (insecure)
Haven't done the access control bit yet.
Modified: servres/trunk/conifer/static/main.css
===================================================================
--- servres/trunk/conifer/static/main.css 2009-03-08 19:08:31 UTC (rev 148)
+++ servres/trunk/conifer/static/main.css 2009-03-08 19:28:49 UTC (rev 149)
@@ -56,7 +56,7 @@
h3 { font-size: 120%; }
h1 { color: navy; }
-h2 { color: #066; }
+h2 { color: #338; }
h3, h4 { color: darkgreen; }
h1 a, h2 a { color: navy; }
@@ -197,7 +197,7 @@
#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; }
Modified: servres/trunk/conifer/syrup/urls.py
===================================================================
--- servres/trunk/conifer/syrup/urls.py 2009-03-08 19:08:31 UTC (rev 148)
+++ servres/trunk/conifer/syrup/urls.py 2009-03-08 19:28:49 UTC (rev 149)
@@ -23,6 +23,7 @@
(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'),
Modified: servres/trunk/conifer/syrup/views.py
===================================================================
--- servres/trunk/conifer/syrup/views.py 2009-03-08 19:08:31 UTC (rev 148)
+++ servres/trunk/conifer/syrup/views.py 2009-03-08 19:28:49 UTC (rev 149)
@@ -276,7 +276,16 @@
if course.access == u'STUDT':
raise NotImplementedError, 'No course sections yet! Coming soon.'
return HttpResponseRedirect('.')
-
+
+ at 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.
Modified: servres/trunk/conifer/templates/add_new_course.xhtml
===================================================================
--- servres/trunk/conifer/templates/add_new_course.xhtml 2009-03-08 19:08:31 UTC (rev 148)
+++ servres/trunk/conifer/templates/add_new_course.xhtml 2009-03-08 19:28:49 UTC (rev 149)
@@ -38,7 +38,15 @@
</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>
More information about the open-ils-commits
mailing list