Skip to content

Commit

Permalink
Merge pull request #6344 from jimchamp/misc-books-page-fixes
Browse files Browse the repository at this point in the history
Misc books page fixes
  • Loading branch information
mekarpeles authored Mar 30, 2022
2 parents 3e3508e + 5a814fa commit 86cbea8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions openlibrary/templates/type/edition/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

$code:
def has_any(*keys):
return any(page[k] for k in keys)
return any(edition[k] for k in keys)

$code:
def get_description(book):
Expand Down Expand Up @@ -249,15 +249,16 @@ <h2 class="edition-byline">$_("by") $:authors_byline</h2>
</div>

$ edition_identifiers = edition.get_identifiers()
$ isbn = None
$ isbns = []
$if 'isbn_13' in edition_identifiers.keys():
$ isbn = edition_identifiers['isbn_13']['value']
$elif 'isbn_10' in edition_identifiers.keys():
$ isbn = edition_identifiers['isbn_10']['value']
$if isbn:
$ isbns.append(edition_identifiers['isbn_13']['value'])
$if 'isbn_10' in edition_identifiers.keys():
$ isbns.append(edition_identifiers['isbn_10']['value'])
$if isbns:
<div class="edition-omniline-item">
<div>ISBN</div>
<span>$isbn</span>
<div>ISBNs</div>
$for isbn in isbns:
<span>$isbn</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -342,7 +343,6 @@ <h3 class="edition-header">$_("First Sentence")</h3>
<p>"$(edition.first_sentence)"</p>
</div>

$if edition:
$ component_times['TableOfContents'] = time()
$:macros.TableOfContents(edition, ocaid)
$ component_times['TableOfContents'] = time() - component_times['TableOfContents']
Expand Down

0 comments on commit 86cbea8

Please sign in to comment.