diff --git a/catalog/templates/performance.html b/catalog/templates/performance.html index a5622bbf..93549eac 100644 --- a/catalog/templates/performance.html +++ b/catalog/templates/performance.html @@ -34,30 +34,34 @@ {% endblock %} {% block content %} - {% for prod in item.productions.all %} - {% if forloop.first %} + {% with item.productions.all as productions %} + {% if productions %}
{% trans '上演版本' %}
- {% endif %} -
-
- {{ prod.title }} -
- {% include '_people.html' with people=prod.troupe _role='剧团' max=2 %} -
- {% if prod.opening_date %}上演日期:{{ prod.opening_date }}{% endif %} -
- {% include '_people.html' with people=prod.location _role='上演剧院' max=2 %} - {% if prod.language %}语言:{{ prod.language }}{% endif %} + {% for prod in productions %} +
+
+ {{ prod.title }} +
+
+ {% include '_people.html' with people=prod.troupe _role='剧团' max=2 %} +
+ {% if prod.opening_date %}上演日期:{{ prod.opening_date }}{% endif %} +
+ {% include '_people.html' with people=prod.location _role='上演剧院' max=2 %} + {% if prod.language %}语言:{{ prod.language }}{% endif %} +
+
+ {% include '_people.html' with people=prod.director role='导演' max=2 %} + {% include '_people.html' with people=prod.playwright role='编剧' max=2 %} + {% include '_people.html' with people=prod.performer role='演员' max=5 %} + {% include '_people.html' with people=prod.composer role='作曲' max=2 %} + {% include '_people.html' with people=prod.choreographer role='编舞' max=2 %} + {% include '_people.html' with people=prod.crew role='演职人员' max=5 %} +
+
+ {% endfor %}
-
- {% include '_people.html' with people=prod.director role='导演' max=2 %} - {% include '_people.html' with people=prod.playwright role='编剧' max=2 %} - {% include '_people.html' with people=prod.performer role='演员' max=5 %} - {% include '_people.html' with people=prod.composer role='作曲' max=2 %} - {% include '_people.html' with people=prod.choreographer role='编舞' max=2 %} - {% include '_people.html' with people=prod.crew role='演职人员' max=5 %} -
-
- {% endfor %} + {% endif %} + {% endwith %} {% endblock %} diff --git a/common/static/scss/_common.scss b/common/static/scss/_common.scss index c902433f..720f2ce3 100644 --- a/common/static/scss/_common.scss +++ b/common/static/scss/_common.scss @@ -14,6 +14,11 @@ -webkit-box-orient: vertical; } +.longlist { + max-height: 60vh; + overflow-y: scroll; +} + .hidden { display: none; } diff --git a/journal/models.py b/journal/models.py index 84d02119..1636ed86 100644 --- a/journal/models.py +++ b/journal/models.py @@ -600,6 +600,7 @@ ShelfTypeNames = [ [ItemCategory.Podcast, ShelfType.PROGRESS, _("在听")], [ItemCategory.Podcast, ShelfType.COMPLETE, _("听过")], [ItemCategory.Performance, ShelfType.WISHLIST, _("想看")], + # disable progress shelf for performance [ItemCategory.Performance, ShelfType.PROGRESS, _("")], [ItemCategory.Performance, ShelfType.COMPLETE, _("看过")], ] @@ -789,8 +790,10 @@ class ShelfManager: def get_label(cls, shelf_type, item_category): ic = ItemCategory(item_category).label st = cls.get_action_label(shelf_type, item_category) - return _("{shelf_label}的{item_category}").format( - shelf_label=st, item_category=ic + return ( + _("{shelf_label}的{item_category}").format(shelf_label=st, item_category=ic) + if st + else None ) @staticmethod diff --git a/journal/views.py b/journal/views.py index b8f7685f..f7e867e5 100644 --- a/journal/views.py +++ b/journal/views.py @@ -832,18 +832,21 @@ def profile(request, user_name): ItemCategory.Music, ItemCategory.Podcast, ItemCategory.Game, + ItemCategory.Performance, ] for category in visbile_categories: shelf_list[category] = {} for shelf_type in ShelfType: - members = user.shelf_manager.get_latest_members( - shelf_type, category - ).filter(qv) - shelf_list[category][shelf_type] = { - "title": user.shelf_manager.get_label(shelf_type, category), - "count": members.count(), - "members": members[:10].prefetch_related("item"), - } + label = user.shelf_manager.get_label(shelf_type, category) + if label is not None: + members = user.shelf_manager.get_latest_members( + shelf_type, category + ).filter(qv) + shelf_list[category][shelf_type] = { + "title": label, + "count": members.count(), + "members": members[:10].prefetch_related("item"), + } reviews = ( Review.objects.filter(owner=user) .filter(qv)