diff --git a/catalog/book/models.py b/catalog/book/models.py index 4b93250f..1b8fcf28 100644 --- a/catalog/book/models.py +++ b/catalog/book/models.py @@ -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 diff --git a/catalog/common/models.py b/catalog/common/models.py index 7c3b8524..b1435531 100644 --- a/catalog/common/models.py +++ b/catalog/common/models.py @@ -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 diff --git a/catalog/templates/edition.html b/catalog/templates/edition.html index 5e311f57..73f020a7 100644 --- a/catalog/templates/edition.html +++ b/catalog/templates/edition.html @@ -74,6 +74,39 @@
contents

{{ item.contents | linebreaksbr }}

{% endif %} + {% with related_books=item.sibling_items %} + {% if related_books.count > 0 %} +
+ + + + + + + + +
{% trans 'other editions' %}
+ +
+ {% endif %} + {% endwith %} {% endblock %} {% block left_sidebar %} - {% with related_books=item.sibling_items %} - {% if related_books.count > 0 %} -
-
- {% trans 'other editions' %} - {% for b in related_books %} -
- {{ b.display_title }} - {{ b.title_deco }} - {% comment %} {% for res in b.external_resources.all %} - - {{ res.site_name.label }} - - {% endfor %} {% endcomment %} -
- {% endfor %} -
-
- {% endif %} - {% endwith %} {% if item.isbn %}
diff --git a/common/templatetags/mastodon.py b/common/templatetags/mastodon.py index 83cb9191..f623f36e 100644 --- a/common/templatetags/mastodon.py +++ b/common/templatetags/mastodon.py @@ -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): diff --git a/docs/origin.md b/docs/origin.md index 254a9971..1e8a992e 100644 --- a/docs/origin.md +++ b/docs/origin.md @@ -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! diff --git a/docs/stylesheets/extra.css b/docs/stylesheets/extra.css index d2ea318a..283aadea 100644 --- a/docs/stylesheets/extra.css +++ b/docs/stylesheets/extra.css @@ -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; + } +} diff --git a/mkdocs.yml b/mkdocs.yml index 60f09ea0..40f8b50b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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