$def with(book, size="M") $ title = book.title_prefix + " " + book.title $ olid = book.key.split("/")[2] $code: def aname(a): if isinstance(a, basestring): return a else: return a.name $ author_names = ", ".join(aname(a) for a in book.authors) or book.get('by_statement','') $ cover_url = book.get_cover_url(size) $if size == "M":
$if cover_url:
$title $_.by $author_names
$else:
$:macros.TruncateString(title, 70)
$:macros.TruncateString(author_names, 30)
$else: $if cover_url: $title $else: $title