From: gfawcett Date: Sun, 8 Mar 2009 20:06:26 +0000 (+0000) Subject: renamed add_new_course* files to edit_course* X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=01af9d3957fee5e212d559311afb1fd1df0177d4;p=syrup%2Fmasslnc.git renamed add_new_course* files to edit_course* they were really add/edit forms after all. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@153 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/static/add_new_course.js b/conifer/static/add_new_course.js deleted file mode 100644 index 40ffd99..0000000 --- a/conifer/static/add_new_course.js +++ /dev/null @@ -1,16 +0,0 @@ -function do_init() { - if ($('#id_code')[0].tagName == 'SELECT') { - // code is a SELECT, so we add a callback to lookup titles. - $('#id_code').change(function() { - $('#id_title')[0].disabled=true; - $.getJSON('/syrup/course/new/ajax_title', {course_code: $(this).val()}, - function(resp) { - $('#id_title').val(resp.title) - $('#id_title')[0].disabled=false; - - }); - }); - } -} - -$(do_init); diff --git a/conifer/static/edit_course.js b/conifer/static/edit_course.js new file mode 100644 index 0000000..40ffd99 --- /dev/null +++ b/conifer/static/edit_course.js @@ -0,0 +1,16 @@ +function do_init() { + if ($('#id_code')[0].tagName == 'SELECT') { + // code is a SELECT, so we add a callback to lookup titles. + $('#id_code').change(function() { + $('#id_title')[0].disabled=true; + $.getJSON('/syrup/course/new/ajax_title', {course_code: $(this).val()}, + function(resp) { + $('#id_title').val(resp.title) + $('#id_title')[0].disabled=false; + + }); + }); + } +} + +$(do_init); diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index 1223e14..c59ac15 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -195,11 +195,11 @@ def add_or_edit_course(request, instance=None): example = models.course_codes.course_code_example if request.method != 'POST': form = NewCourseForm(instance=instance) - return g.render('add_new_course.xhtml', **locals()) + return g.render('edit_course.xhtml', **locals()) else: form = NewCourseForm(request.POST, instance=instance) if not form.is_valid(): - return g.render('add_new_course.xhtml', **locals()) + return g.render('edit_course.xhtml', **locals()) else: form.save() course = form.instance diff --git a/conifer/templates/add_new_course.xhtml b/conifer/templates/add_new_course.xhtml deleted file mode 100644 index fd11b23..0000000 --- a/conifer/templates/add_new_course.xhtml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - ${title} -