lib.itmens/catalog/templates/edition.html
2025-01-01 10:54:40 -05:00

195 lines
6.6 KiB
HTML

{% extends "item_base.html" %}
{% load static %}
{% load i18n %}
{% load l10n %}
{% load humanize %}
{% load mastodon %}
{% load strip_scheme %}
{% load thumb %}
{% block head %}
{% if item.author %}
<meta property="og:book:author"
content="{% for author in item.author %}{{ author }}{% if not forloop.last %},{% endif %}{% endfor %}">
{% endif %}
{% if item.isbn %}<meta property="og:book:isbn" content="{{ item.isbn }}">{% endif %}
{% endblock %}
{% block details %}
<div>
{% if item.isbn %}
{% trans 'ISBN' %}: {{ item.isbn }}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.author role='author' max=5 %}</div>
<div>{% include '_people.html' with people=item.translator role='translator' max=5 %}</div>
<div>
{% if item.format %}
{% trans 'book format' %}: {{ item.get_format_display }}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.additional_title role='other title' max=99 %}</div>
<div>
{% if item.pub_house %}
{% trans 'publishing house' %}: {{ item.pub_house }}
{% endif %}
</div>
<div>
{% if item.imprint %}
{% trans 'imprint' %}: {{ item.imprint }}
{% endif %}
</div>
<div>
{% if item.pub_year %}
{% trans 'publication date' %}: {{ item.pub_year }}
{% if item.pub_month %}-{{ item.pub_month }}{% endif %}
{% endif %}
</div>
<div>
{% if item.series %}
{% trans 'series' %}: {{ item.series }}
{% endif %}
</div>
<div>{% include '_people.html' with people=item.language role='language' max=10 %}</div>
<div>
{% if item.binding %}
{% trans 'binding' %}: {{ item.binding }}
{% endif %}
</div>
<div>
{% if item.price %}
{% trans 'price' %}: {{ item.price }}
{% endif %}
</div>
<div>
{% if item.pages %}
{% trans 'number of pages' %}: {{ item.pages }}
{% endif %}
</div>
{% if item.other_info %}
{% for k, v in item.other_info.items %}<div>{{ k }}: {{ v|urlizetrunc:24 }}</div>{% endfor %}
{% endif %}
{% endblock %}
{% block content %}
{% if item.contents %}
<h5>contents</h5>
<p class="tldr" _="on click toggle .tldr on me">{{ item.contents | linebreaksbr }}</p>
{% endif %}
{% with related_books=item.sibling_items %}
{% if related_books.count > 0 %}
<section class="entity-sort shelf" id="sibling">
<span class="action">
<span>
<a _="on click set el to the next <ul/> then call el.scrollBy({left:-el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-left"></i></a>
</span>
<span>
<a _="on click set el to the next <ul/> then call el.scrollBy({left:el.offsetWidth, behavior:'smooth'})"><i class="fa-solid fa-circle-right"></i></a>
</span>
</span>
<h5>{% trans 'other editions' %}</h5>
<ul class="cards">
{% for b in related_books %}
<li class="card">
<a href="{{ b.url }}" title="{{ b.display_title }} {{ b.title_deco }}">
<img src="{{ b.cover|thumb:'normal' }}"
alt="{{ b.display_title }} {{ b.title_deco }}"
loading="lazy">
<div>
{{ b.display_title }} <small class="title_deco">{{ b.title_deco }}</small>
</div>
</a>
</li>
{% endfor %}
</ul>
</section>
{% endif %}
{% endwith %}
{% endblock %}
{% block left_sidebar %}
<script>
$(function () {
function _sidebar_auto_collapse(mm){
if (mm.matches) {
$('.auto-collapse').removeAttr('open')
} else {
$('.auto-collapse').attr('open', '')
}
}
var mm = window.matchMedia("(max-width: 768px)")
mm.addListener(_sidebar_auto_collapse);
_sidebar_auto_collapse(mm);
});
</script>
{% if item.isbn %}
<section>
<details class="auto-collapse" open>
<summary>{% trans 'Borrow or Buy' %}</summary>
<div>
<div>
<a target="_blank"
rel="noopener"
href="https://www.worldcat.org/isbn/{{ item.isbn }}">WorldCat</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://openlibrary.org/search?isbn={{ item.isbn }}">Open Library</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://library.oapen.org/discover?filtertype_1=isbn&amp;filter_relational_operator_1=equals&amp;filter_1={{ item.isbn }}">
OAPEN</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://bookshop.org/search?keywords={{ item.isbn }}">Bookshop.org</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://www.amazon.com/s?k={{ item.isbn }}">Amazon</a>
<a target="_blank"
rel="noopener"
href="https://www.amazon.de/s?k={{ item.isbn }}">DE</a>
<a target="_blank"
rel="noopener"
href="https://www.amazon.co.jp/s?k={{ item.isbn }}">JP</a>
<a target="_blank"
rel="noopener"
href="https://www.amazon.co.uk/s?k={{ item.isbn }}">UK</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://www.kobo.com/search?query={{ item.isbn }}">Kobo</a>
<a target="_blank"
rel="noopener"
href="https://www.kobo.com/jp/en/search?query={{ item.isbn }}">JP</a>
<a target="_blank"
rel="noopener"
href="https://www.kobo.com/tw/zh/search?query={{ item.isbn }}">TW</a>
<a target="_blank"
rel="noopener"
href="https://www.kobo.com/us/en/search?query={{ item.isbn }}">US</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://www.duozhuayu.com/search/book/{{ item.isbn }}">多抓鱼</a>
<a target="_blank"
rel="noopener"
href="https://search.kongfz.com/product_result/?key={{ item.isbn }}">孔夫子旧书</a>
</div>
<div>
<a target="_blank"
rel="noopener"
href="https://search.books.com.tw/search/query/key/{{ item.isbn }}/cat/all">博客来</a>
<a target="_blank"
rel="noopener"
href="https://readmoo.com/search/keyword?q={{ item.isbn }}">Readmoo 讀墨</a>
</div>
</div>
</details>
</section>
{% endif %}
{% endblock %}