From 434d5fd386b881769872c58e992a5e1cbf291309 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Mon, 12 Jan 2009 02:30:24 +0000 Subject: [PATCH] The URL of a "URL item" is now its URL. That is, if an item is of the "URL" type, and you ask the system for the display-URL of the item, you'll get the payload URL, rather than a system URL that redirects to the payload. The upside of this is that the target URL is visible in the status-bar when the user hovers over it, and that's good for usability IMHO. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@111 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- conifer/genshi_namespace.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conifer/genshi_namespace.py b/conifer/genshi_namespace.py index 71dc9a8..6cb5f1d 100644 --- a/conifer/genshi_namespace.py +++ b/conifer/genshi_namespace.py @@ -11,7 +11,10 @@ from conifer.syrup import models # approach? def item_url(item, suffix=''): - return '/syrup/course/%d/item/%d/%s' % (item.course_id, item.id, suffix) + if item.item_type == 'URL' and suffix == '': + return item.url + else: + return '/syrup/course/%d/item/%d/%s' % (item.course_id, item.id, suffix) def course_url(course, suffix=''): return '/syrup/course/%d/%s' % (course.id, suffix) -- 2.11.0