[open-ils-commits] r111 - servres/trunk/conifer

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Jan 11 21:30:25 EST 2009


Author: gfawcett
Date: 2009-01-11 21:30:24 -0500 (Sun, 11 Jan 2009)
New Revision: 111

Modified:
   servres/trunk/conifer/genshi_namespace.py
Log:
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.


Modified: servres/trunk/conifer/genshi_namespace.py
===================================================================
--- servres/trunk/conifer/genshi_namespace.py	2009-01-12 02:21:02 UTC (rev 110)
+++ servres/trunk/conifer/genshi_namespace.py	2009-01-12 02:30:24 UTC (rev 111)
@@ -11,7 +11,10 @@
 # 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)



More information about the open-ils-commits mailing list