From 7ea1adce4e03f247e60146452bb7576e3a49c3e5 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Wed, 8 Apr 2009 01:43:41 +0000 Subject: [PATCH] fixed more absolute-root problems. Introduced ROOT global Genshi variable. ROOT can be used in templates: it has the value of the CGI variable SCRIPT_NAME, so we can use it to determine what the root-prefix of the app is. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@300 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/genshi_support.py | 1 + conifer/settings.py | 2 ++ conifer/templates/browse_index.xhtml | 2 +- conifer/templates/course_detail.xhtml | 2 +- conifer/templates/edit_course.xhtml | 2 +- conifer/templates/edit_course_permissions.xhtml | 2 +- conifer/templates/feeds/course_feed_index.xhtml | 2 +- conifer/templates/item_heading_detail.xhtml | 2 +- conifer/templates/item_relocate.xhtml | 2 +- conifer/templates/master.xhtml | 21 ++++++++++----------- conifer/templates/prefs.xhtml | 2 +- conifer/templates/tabbar.xhtml | 10 +++++----- conifer/templates/tabbar_anonymous.xhtml | 4 ++-- 13 files changed, 28 insertions(+), 26 deletions(-) diff --git a/conifer/genshi_support.py b/conifer/genshi_support.py index 54c9ec6..da40313 100644 --- a/conifer/genshi_support.py +++ b/conifer/genshi_support.py @@ -37,6 +37,7 @@ def template(tname): def _inject_django_things_into_namespace(request, ns): ns['_'] = _ ns['request'] = request + ns['ROOT'] = request.META['SCRIPT_NAME'] ns['user'] = getattr(request, 'user', None) ns.update(genshi_namespace.__dict__) diff --git a/conifer/settings.py b/conifer/settings.py index a2b84ae..a1a0f89 100644 --- a/conifer/settings.py +++ b/conifer/settings.py @@ -5,6 +5,8 @@ import os +os.environ['PYTHON_EGG_CACHE'] = '/tmp/eggs' + BASE_DIRECTORY = os.path.abspath(os.path.dirname(__file__)) HERE = lambda s: os.path.join(BASE_DIRECTORY, s) diff --git a/conifer/templates/browse_index.xhtml b/conifer/templates/browse_index.xhtml index 02cf5ae..64df7ba 100644 --- a/conifer/templates/browse_index.xhtml +++ b/conifer/templates/browse_index.xhtml @@ -11,7 +11,7 @@ title = _('Browse the Reserves')

${title}

(Note: some course materials may require you - to log in) + to log in)

Choose from one of the options below: