Example #1
0
 def transform(wldoc, fieldfile):
     # ugly, but we can't use wldoc.book_info here
     from librarian import DCNS
     url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url'))
     if url_elem is None:
         gallery = ''
     else:
         gallery = gallery_url(slug=url_elem.text.rsplit('/', 1)[1])
     return wldoc.as_html(options={'gallery': "'%s'" % gallery})
Example #2
0
 def transform(wldoc, fieldfile):
     # ugly, but we can't use wldoc.book_info here
     from librarian import DCNS
     url_elem = wldoc.edoc.getroot().find('.//' + DCNS('identifier.url'))
     if url_elem is None:
         gallery = ''
     else:
         gallery = gallery_url(slug=url_elem.text.rsplit('/', 1)[1])
     return wldoc.as_html(options={'gallery': "'%s'" % gallery})
Example #3
0
 def gallery_url(self):
     return gallery_url(self.slug)