Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add edition info to book details section #7108

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions openlibrary/templates/type/edition/publisher_line.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$def with (edition)

$if edition:
<h4 class="publisher">
$if edition.publish_date or edition.publishers or edition.publish_places:
<!-- TODO: this handcrafted concatenation will be difficult to internationalize -->
$_('This edition was published')
$if edition.publish_date:
$_('in') <strong itemprop="datePublished">$edition.publish_date</strong>
$if edition.publishers:
$_('by')
$for p in edition.publishers:
$if "publishers" in ctx.features:
<a itemprop="publisher" href="/publishers/$p.replace(' ', '_')"
title="$_('Show other books from %(publisher)s', publisher=p)"
>$p</a>$cond(loop.last, "", ", ")
$else:
<a itemprop="publisher" href="/search?publisher_facet=$p.replace('&','%26')"
title="$_('Search for other books from %(publisher)s', publisher=p)"
>$p</a>$cond(loop.last, "", ", ")
$if edition.publish_places:
$_('in')
$for p in edition.publish_places:
<a href="/search/subjects?q=$p.replace('&','%26').replace(' ','%20')"
title="$_('Search for subjects about %(place)s', place=p)"
>$p</a>$cond(loop.last, "", ", ")<span class="adjust">.</span>
</h4>
13 changes: 12 additions & 1 deletion openlibrary/templates/type/edition/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,18 @@
$if edition:
<h2 class="details-title" itemprop="name">$_("Book Details")</h2>
<hr>
$if edition.publish_places:
$if is_privileged_user:
<h3 class="work-title" itemprop="name">$book_title</h3>
$if edition.subtitle:
<h3>
$edition.subtitle
</h3>
$if edition.edition_name:
<div class="work-line">
$edition.edition_name
</div>
$:render_template("type/edition/publisher_line", edition)
$if edition.publish_places and not is_privileged_user:
<div class="section">
<h3 class="edition-header">$_('Published in')</h3>
<p>
Expand Down