animate the unhide and sort related books

This commit is contained in:
Your Name 2023-06-08 19:57:10 -04:00 committed by Henri Dickson
parent 41a98d77a6
commit c703e2e4ff
3 changed files with 15 additions and 2 deletions

View file

@ -171,6 +171,7 @@ class Edition(Item):
.exclude(pk=self.pk)
.exclude(is_deleted=True)
.exclude(merged_to_item__isnull=False)
.order_by("title")
)

View file

@ -84,9 +84,9 @@
</div>
{% if dup_items %}
<p class="empty">
已从结果中略去了来自同一著作或有相同标识号的 {{ dup_items|length }}个条目,<a href="#" _="on click toggle .hidden on #dup">点击这里可重新显示</a>
已从结果中略去了来自同一著作或有相同标识号的 {{ dup_items|length }}个条目,<a _="on click toggle .unfold on #dup">点击这里可重新显示</a>
</p>
<div class="item-card-list hidden" id="dup">
<div class="item-card-list folded" id="dup">
{% for item in dup_items %}
{% with "list_item_"|add:item.class_name|add:".html" as template %}
{% include template with show_tags=1 %}

View file

@ -27,6 +27,18 @@
visibility: hidden;
}
.folded {
max-height: 0;
transform: scaleY(0);
transform-origin: top;
transition: transform 0.2s ease;
}
.folded.unfold {
max-height: max-content;
transform: scaleY(1);
}
a:not(:hover) {
text-decoration: none;
}