lib.itmens/catalog/templates/album.html

124 lines
3.7 KiB
HTML
Raw Normal View History

2022-12-15 17:29:35 -05:00
{% extends "item_base.html" %}
{% load static %}
{% load i18n %}
{% load l10n %}
{% load humanize %}
{% load admin_url %}
{% load mastodon %}
{% load oauth_token %}
{% load truncate %}
{% load strip_scheme %}
{% load thumb %}
2023-01-05 03:06:13 -05:00
{% load duration %}
2022-12-15 17:29:35 -05:00
<!-- class specific details -->
{% block details %}
2022-12-16 01:08:10 -05:00
<div class="entity-detail__fields">
<div class="entity-detail__rating">
2022-12-27 14:52:03 -05:00
{% if item.rating and item.rating_count >= 5 %}
2022-12-16 01:08:10 -05:00
<span class="entity-detail__rating-star rating-star" data-rating-score="{{ item.rating | floatformat:"0" }}"></span>
2022-12-31 18:55:27 -05:00
<span class="entity-detail__rating-score"> {{ item.rating | floatformat:1 }} </span>
2022-12-27 14:52:03 -05:00
<small>({{ item.rating_count }}人评分)</small>
2022-12-16 01:08:10 -05:00
{% else %}
<span> {% trans '评分:评分人数不足' %}</span>
{% endif %}
</div>
<div>{% if item.artist %}{% trans '艺术家:' %}
{% for artist in item.artist %}
<span {% if forloop.counter > 5 %}style="display: none;" {% endif %}>
<span class="artist">{{ artist }}</span>
{% if not forloop.last %} / {% endif %}
</span>
{% endfor %}
{% if item.artist|length > 5 %}
<a href="javascript:void(0);" id="artistMore">{% trans '更多' %}</a>
<script>
$("#artistMore").on('click', function (e) {
$("span.artist:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}</div>
<div>{% if item.company %}{% trans '发行方:' %}
{% for company in item.company %}
<span {% if forloop.counter > 5 %}style="display: none;" {% endif %}>
<span class="company">{{ company }}</span>
{% if not forloop.last %} / {% endif %}
</span>
{% endfor %}
{% if item.company|length > 5 %}
<a href="javascript:void(0);" id="companyMore">{% trans '更多' %}</a>
<script>
$("#companyMore").on('click', function (e) {
$("span.company:not(:visible)").each(function (e) {
$(this).parent().removeAttr('style');
});
$(this).remove();
})
</script>
{% endif %}
{% endif %}</div>
<div>{% if item.release_date %}
{% trans '发行日期:' %}{{ item.release_date }}
{% endif %}
</div>
<div>{% if item.duration %}
{% trans '时长:' %}{{ item.duration|duration_format:1000 }}
2022-12-16 01:08:10 -05:00
{% endif %}
</div>
<div>{% if item.genre %}
{% trans '流派:' %}
{% for genre in item.genre %}
<span>{{ genre }}</span>{% if not forloop.last %} / {% endif %}
{% endfor %}
2022-12-16 01:08:10 -05:00
{% endif %}
</div>
<div>{% if item.barcode %}
{% trans '条形码:' %}{{ item.barcode }}
{% endif %}
</div>
</div>
<div class="entity-detail__fields">
<div>{% if item.other_title %}
{% trans '又名:' %}
{% for t in item.other_title %}
<span>{{ t }}</span>{% if not forloop.last %} / {% endif %}
{% endfor %}
2022-12-16 01:08:10 -05:00
{% endif %}
</div>
<div>{% if item.album_type %}
{% trans '专辑类型:' %}{{ item.album_type }}
{% endif %}
</div>
<div>{% if item.media %}
{% trans '介质:' %}{{ item.media }}
{% endif %}
</div>
<div>{% if item.disc_count %}
{% trans '碟片数:' %}{{ item.disc_count }}
{% endif %}
</div>
2022-12-23 00:08:42 -05:00
{% if item.last_editor and item.last_editor.preference.show_last_edit %}
<div>{% trans '最近编辑者:' %}<a href="{% url 'journal:user_profile' item.last_editor.mastodon_username %}">{{ item.last_editor | default:"" }}</a></div>
2022-12-16 01:08:10 -05:00
{% endif %}
<div>
2023-01-08 23:28:19 -05:00
{% if user.is_authenticated %}
<a href="{% url 'catalog:edit' item.url_path item.uuid %}">{% trans '编辑' %}{{ item.demonstrative }}</a>
{% endif %}
2022-12-16 01:08:10 -05:00
</div>
</div>
2022-12-15 17:29:35 -05:00
{% endblock %}
<!-- class specific sidebar -->
{% block sidebar %}
2022-12-16 01:08:10 -05:00
{% if item.get_embed_link %}
<iframe src="{{ item.get_embed_link }}" height="320" frameborder="0" allowtransparency="true" allow="encrypted-media"></iframe>
{% endif %}
2022-12-15 17:29:35 -05:00
{% endblock %}