sort related edition by publishing year
This commit is contained in:
parent
92be22f525
commit
0e32bb2ebe
7 changed files with 45 additions and 26 deletions
|
@ -288,6 +288,7 @@ class Edition(Item):
|
|||
.exclude(pk=self.pk)
|
||||
.exclude(is_deleted=True)
|
||||
.exclude(merged_to_item__isnull=False)
|
||||
.order_by("-metadata__pub_year")
|
||||
)
|
||||
|
||||
@property
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import re
|
||||
import uuid
|
||||
from functools import cached_property
|
||||
from typing import TYPE_CHECKING, Any, Iterable, Self, Type, cast
|
||||
from typing import TYPE_CHECKING, Any, Iterable, Self, Sequence, Type, cast
|
||||
|
||||
from auditlog.context import disable_auditlog
|
||||
from auditlog.models import AuditlogHistoryField, LogEntry
|
||||
|
|
|
@ -74,6 +74,39 @@
|
|||
<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>
|
||||
|
@ -90,26 +123,6 @@
|
|||
_sidebar_auto_collapse(mm);
|
||||
});
|
||||
</script>
|
||||
{% with related_books=item.sibling_items %}
|
||||
{% if related_books.count > 0 %}
|
||||
<section>
|
||||
<details class="auto-collapse" open>
|
||||
<summary>{% trans 'other editions' %}</summary>
|
||||
{% for b in related_books %}
|
||||
<div>
|
||||
<a href="{{ b.url }}">{{ b.display_title }}</a>
|
||||
<small class="title_deco">{{ b.title_deco }}</small>
|
||||
{% comment %} {% for res in b.external_resources.all %}
|
||||
<a href="{{ res.url }}" rel="noopener noreferrer">
|
||||
<span class="source-label source-label__{{ res.site_name }}">{{ res.site_name.label }}</span>
|
||||
</a>
|
||||
{% endfor %} {% endcomment %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</details>
|
||||
</section>
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% if item.isbn %}
|
||||
<section>
|
||||
<details class="auto-collapse" open>
|
||||
|
|
|
@ -27,7 +27,7 @@ def current_user_relationship(context, target_identity: "APIdentity"):
|
|||
"rejecting": False,
|
||||
"status": "",
|
||||
}
|
||||
if current_identity and current_identity != target_identity:
|
||||
if target_identity and current_identity and current_identity != target_identity:
|
||||
if current_identity.is_blocking(
|
||||
target_identity
|
||||
) or current_identity.is_blocked_by(target_identity):
|
||||
|
|
|
@ -13,4 +13,4 @@ As we’ve gained some [initial attraction](https://blog.joinmastodon.org/2021/1
|
|||
NeoDB is a fork of [NiceDB](https://github.com/doubaniux/boofilsic), our code is actively being developed and is open-sourced under the AGPL-v3 license. We highly welcome contributions in code, design, and localization.
|
||||
|
||||
|
||||
Please follow us on Fediverse([en](https://mastodon.online/@neodb)|[cn](https://mastodon.social/@neodb)) / [Twitter](https://x.com/NeoDBsocial) / [Bluesky](https://bsky.app/profile/neodb.bsky.social), and help spread the words. Thank you for the support!
|
||||
Please follow us on Fediverse([en](https://mastodon.online/@neodb)|[cn](https://mastodon.social/@neodb)) / [Bluesky](https://bsky.app/profile/neodb.net) / [Twitter](https://x.com/NeoDBsocial), and help spread the words. Thank you for the support!
|
||||
|
|
|
@ -7,3 +7,8 @@
|
|||
--md-accent-fg-color--dark: #01aaff;
|
||||
font-family:system-ui, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
}
|
||||
@media screen and (min-width: 76.25em) {
|
||||
.md-nav__title {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ repo_url: http://github.com/neodb-social/neodb
|
|||
edit_uri: blob/main/docs/
|
||||
site_description: Mark the things you love.
|
||||
nav:
|
||||
- About: 'index.md'
|
||||
- Overview: 'index.md'
|
||||
- features.md
|
||||
- install.md
|
||||
- upgrade.md
|
||||
|
@ -29,12 +29,12 @@ extra:
|
|||
social:
|
||||
- icon: fontawesome/brands/mastodon
|
||||
link: https://mastodon.online/@neodb/
|
||||
- icon: fontawesome/brands/bluesky
|
||||
link: https://bsky.app/profile/neodb.net
|
||||
- icon: fontawesome/brands/x-twitter
|
||||
link: https://twitter.com/NeoDBsocial
|
||||
- icon: fontawesome/brands/threads
|
||||
link: https://www.threads.net/@neodb.social
|
||||
- icon: fontawesome/brands/bluesky
|
||||
link: https://bsky.app/profile/neodb.bsky.social
|
||||
- icon: fontawesome/brands/discord
|
||||
link: https://discord.gg/QBHkrV8bxK
|
||||
- icon: fontawesome/brands/github
|
||||
|
|
Loading…
Add table
Reference in a new issue