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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
$def with (results, fulltext=False) $ _ = i18n.get_namespace('/search') <table border="0" cellpadding="0" cellspacing="0" width="100%" class="result-item"> $for b in results: $if fulltext: $ book = b[0] $ ocaid = b[1] $ pages = b[2] $else: $ book = b $ ocaid = None <tr> <td class="cover"> $ olid = book.key.split('/')[-1] <a href="$book.key"><img src="http://covers.openlibrary.org/b/olid/$olid-S.jpg?default=http://wiki-beta.us.archive.org/static/images/blank.book.png" height="58"/></a> </td> <td class="result-text" valign="top"> <a href="$book.key/$book.title.replace(' ', '-')" class="result">$book.title_prefix $book.title</a> <span class="result-small">$_.by $for author in book.authors: $:thingrepr(author) </span> <div class="result-small"> $if book.publishers: ($(', '.join(book.publishers)), $book.publish_date) $else: ($book.publish_date) $book.physical_format $if book.ocaid: <a href="/bookreader/$book.ocaid"><div class="small-button fulltext">$_.fulltext</div></a> </div> $if fulltext: <p> $for pn, pg in pages: <a href="http://openlibrary.org/bookreader/$ocaid/leaf$(pn / 2)">$pg</a> </p> </td></tr> </table> |