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
# 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)