It looks like you're offline.
Open Library logo
additional options menu

This doc was last edited by Anand Chitipothu June 19, 2009.

plugin upstream
Templates in the website are disabled now. Editing them will not have any effect on the live website.
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
$def with (results, fulltext=False)

$ _ = i18n.get_namespace('/search')

$code:
    def aname(a):
        if isinstance(a, basestring):
            return a
        else:
            return a.name

$for b in results:
        $if fulltext:
            $ book = b[0]
            $ ocaid = b[1]
            $ pages = b[2]
        $else:
            $ book = b
            $ ocaid = None
        $ olid = book.key.split('/')[-1]
        $ authorlist = ', '.join([aname(author) for author in book.authors])
        $if book.ocaid:
            $ authorlist = authorlist + ' (' + str(_.fulltext) + ')'
        <a href="$book.key" title="$book.title_prefix $book.title $_.by $:authorlist">
            $:macros.SRPCoverImage(book)
        </a>