From: gfawcett Date: Sun, 8 Mar 2009 19:28:49 +0000 (+0000) Subject: added course-site deletion (insecure) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=9eddf78bb22324207e20ec29c02991d3b128b9bc;p=Syrup.git added course-site deletion (insecure) Haven't done the access control bit yet. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@149 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/static/main.css b/conifer/static/main.css index 7560fec..83071f7 100644 --- a/conifer/static/main.css +++ b/conifer/static/main.css @@ -56,7 +56,7 @@ h2 { font-size: 135%; } 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 @@ p.todo, div.todo { background-color: #fdd; padding: 6; margin: 12; border-left: #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; } diff --git a/conifer/syrup/urls.py b/conifer/syrup/urls.py index 5bba02a..433502c 100644 --- a/conifer/syrup/urls.py +++ b/conifer/syrup/urls.py @@ -23,6 +23,7 @@ urlpatterns = patterns('conifer.syrup.views', (r'^department/(?P.*)/$', 'department_detail'), (r'^course/(?P\d+)/search/$', 'course_search'), (r'^course/(?P\d+)/edit/$', 'edit_course'), + (r'^course/(?P\d+)/edit/delete/$', 'delete_course'), (r'^course/(?P\d+)/edit/permission/$', 'edit_course_permissions'), (ITEM_PREFIX + r'$', 'item_detail'), (ITEM_PREFIX + r'dl/(?P.*)$', 'item_download'), diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index 7f2da57..90b5473 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -276,7 +276,16 @@ def edit_course_permissions(request, course_id): 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. diff --git a/conifer/templates/add_new_course.xhtml b/conifer/templates/add_new_course.xhtml index 19d83de..fd11b23 100644 --- a/conifer/templates/add_new_course.xhtml +++ b/conifer/templates/add_new_course.xhtml @@ -38,7 +38,15 @@ else:

-
+
+

Delete this course

+
+

+ +

+

+
+