/upstream/templates/covers/book_cover.tmpl
Type: /type/template
body: value: $def with(book, size="M")

$ title = book.title
$ author_names = None
$if any(book.get_authors()):
    $ author_names = ", ".join(a.get("name", "Name missing") for a in book.get_authors())
$if not author_names:
    $ author_names = book.get('by_statement','')

$ cover_url = book.get_cover_url(size)

$ cover_lg = book.get_cover_url("L")

$if size == "M":
    <div class="coverMagic">
            <div class="SRPCover bookCover" style="display: $cond(cover_url, 'block', 'none');">
                <a href="$cover_lg" class="coverLook" title="Pull up a bigger book cover"><img src="$cover_url" class="cover" alt="Cover of: $title $_('by') $author_names"/></a>
            </div>
            <div class="SRPCoverBlank" style="display: $cond(not cover_url, 'block', 'none');">
                <div class="innerBorder">
                    <div class="BookTitle">$:macros.TruncateString(title, 70)
                        <div class="Author">$:macros.TruncateString(author_names, 30)</div>
                    </div>
                </div>
            </div>
    </div>
$else:
    <img src="$(cover_url or '/images/icons/avatar_book-sm.png')" height="58" title="$title" alt="We need a book cover for: $title"/>

<div class="hidden">
    <div class="coverFloat" id="seeImage">
        <div class="coverFloatHead">
            $:macros.TruncateString(title, 70)
            <a class="floaterShut" href="javascript:;" onclick="\$.fn.colorbox.close();"><span class="shift">$_("Close")</span></a>
        </div>
        <a href="javascript:;" onclick="\$.fn.colorbox.close();"><img src="$cover_lg" class="cover" alt="$title $_('by') $author_names"/></a>
    </div>
</div>