disable progress shelf for performance
This commit is contained in:
parent
a2611272c2
commit
e5641c7d5f
4 changed files with 48 additions and 33 deletions
|
@ -34,30 +34,34 @@
|
|||
</div>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
{% for prod in item.productions.all %}
|
||||
{% if forloop.first %}
|
||||
{% with item.productions.all as productions %}
|
||||
{% if productions %}
|
||||
<h5>{% trans '上演版本' %}</h5>
|
||||
{% endif %}
|
||||
<hgroup>
|
||||
<h6>
|
||||
<a href="{{ prod.url }}">{{ prod.title }}</a>
|
||||
</h6>
|
||||
<div>
|
||||
{% include '_people.html' with people=prod.troupe _role='剧团' max=2 %}
|
||||
<div>
|
||||
{% if prod.opening_date %}上演日期:{{ prod.opening_date }}{% endif %}
|
||||
</div>
|
||||
{% include '_people.html' with people=prod.location _role='上演剧院' max=2 %}
|
||||
{% if prod.language %}语言:{{ prod.language }}{% endif %}
|
||||
{% for prod in productions %}
|
||||
<hgroup>
|
||||
<h6>
|
||||
<a href="{{ prod.url }}">{{ prod.title }}</a>
|
||||
</h6>
|
||||
<div>
|
||||
{% include '_people.html' with people=prod.troupe _role='剧团' max=2 %}
|
||||
<div>
|
||||
{% if prod.opening_date %}上演日期:{{ prod.opening_date }}{% endif %}
|
||||
</div>
|
||||
{% include '_people.html' with people=prod.location _role='上演剧院' max=2 %}
|
||||
{% if prod.language %}语言:{{ prod.language }}{% endif %}
|
||||
</div>
|
||||
<div class="tldr-2">
|
||||
{% 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 %}
|
||||
</div>
|
||||
</hgroup>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="tldr-2">
|
||||
{% 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 %}
|
||||
</div>
|
||||
</hgroup>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -14,6 +14,11 @@
|
|||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.longlist {
|
||||
max-height: 60vh;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue