lib.itmens/custom/edition.custom.html
gesang 2eabe273f5
Some checks are pending
code check / lint (3.12) (push) Waiting to run
code check / type-checker (3.12) (push) Waiting to run
Mirror to Codeberg / to_codeberg (push) Waiting to run
unit test / django (3.12) (push) Waiting to run
typo
2025-03-10 18:08:36 +01:00

192 lines
5.9 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>
<span>{{ b.display_title }}</span>
<small class="title_deco"><span>{{ b.pub_house }}</span>
<span>{{ b.pub_year }}</span></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>
</details>
</section>
{% endif %}
{% if request.user.is_authenticated %}
<section>
<details class="auto-collapse" open>
<summary>Shadow Libraries</summary>
{% if item.isbn %}
<div>
Search by ISBN:<br>
<a target="_blank"
rel="noopener"
href="https://annas-archive.org/search?q={{ item.isbn }}">Anna's Archive</a>
|
<a target="_blank"
rel="noopener"
href="https://z-lib.gs/s/{{ item.isbn }}">Z-Library</a>
|
<a target="_blank"
rel="noopener"
href="https://libgen.li/index.php?req={{ item.isbn }}">Libgen+LI</a>
</div>
{% endif %}
<div>
Search by title:<br>
<a target="_blank"
rel="noopener"
href="https://annas-archive.org/search?q={{ item.display_title }}">Anna's Archive</a>
|
<a target="_blank"
rel="noopener"
href="https://z-lib.gs/s/{{ item.display_title }}">Z-Library</a>
|
<a target="_blank"
rel="noopener"
href="https://libgen.li/index.php?req={{ item.display_title }}">Libgen+LI</a>
</div>
<div>
<br>
Registered user only:<br>
<a target="_blank"
rel="noopener"
href="https://dufs.itinerariummentis.org/book/?q={{ item.display_title }}">dufs.itmens</a>
</div>
</details>
</section>
{% endif %}
{% endblock %}