From ffac1a804ff616634e43d174cc783c15b4af2605 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Fri, 22 Jan 2010 03:20:58 +0000 Subject: [PATCH] fixed title-lookup during edit-course The buggy version had a bad hard-coded prefix in the lookup-title URL. I've added a ROOT variable in JavaScript, set to the URL prefix (the SCRIPT_NAME) of the Syrup instance; and now we use this to correctly find the lookup-title service. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@763 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/static/edit_course.js | 7 ++----- conifer/templates/edit_course.xhtml | 6 ------ conifer/templates/master.xhtml | 4 ++++ 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/conifer/static/edit_course.js b/conifer/static/edit_course.js index 8373aaf..88022cd 100644 --- a/conifer/static/edit_course.js +++ b/conifer/static/edit_course.js @@ -1,12 +1,9 @@ -/* -this seems to be causing a disable when we don't want it -*/ function do_init() { - if ($('#id_code')[0].tagName == 'SELECT') { + if ($('#id_code').attr('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()}, + $.getJSON(ROOT + '/course/new/ajax_title', {course_code: $(this).val()}, function(resp) { $('#id_title').val(resp.title) $('#id_title')[0].disabled=false; diff --git a/conifer/templates/edit_course.xhtml b/conifer/templates/edit_course.xhtml index 8c6c1de..7f7ec0c 100644 --- a/conifer/templates/edit_course.xhtml +++ b/conifer/templates/edit_course.xhtml @@ -11,13 +11,7 @@ else: ${title} - -
${course_banner(instance)}
diff --git a/conifer/templates/master.xhtml b/conifer/templates/master.xhtml index 7f36382..0786588 100644 --- a/conifer/templates/master.xhtml +++ b/conifer/templates/master.xhtml @@ -12,6 +12,10 @@ import os py:with="t=list(select('title/text()'))"> ${app_name}<py:if test="t">: ${t}</py:if> + + -- 2.11.0