365 lines
16 KiB
HTML
365 lines
16 KiB
HTML
{% load static %}
|
|
{% load i18n %}
|
|
{% load l10n %}
|
|
{% load humanize %}
|
|
{% load admin_url %}
|
|
{% load mastodon %}
|
|
{% load oauth_token %}
|
|
{% load truncate %}
|
|
{% load strip_scheme %}
|
|
{% load thumb %}
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="og:title" content="{{ site_name }}{% trans item.category.label %} - {{ item.title }}">
|
|
<meta property="og:type" content="book">
|
|
<meta property="og:url" content="{{ request.build_absolute_uri }}">
|
|
<meta property="og:image" content="{{ request.scheme }}://{{ request.get_host }}{{ item.cover.url }}">
|
|
<meta property="og:site_name" content="{{ site_name }}">
|
|
<meta property="og:description" content="{{ item.brief }}">
|
|
{% if item.author %}
|
|
<meta property="og:book:author" content="{% for author in item.author %}{{ author }}{% if not forloop.last %},{% endif %}{% endfor %}">
|
|
{% endif %}
|
|
{% if item.isbn %}
|
|
<meta property="og:book:isbn" content="{{ item.isbn }}">
|
|
{% endif %}
|
|
|
|
<title>{{ site_name }} - {% trans item.category.label %} | {{ item.title }}</title>
|
|
|
|
{% include "partial/_common_libs.html" with jquery=1 %}
|
|
|
|
<script src="{% static 'lib/js/rating-star.js' %}"></script>
|
|
<script src="{% static 'js/detail.js' %}"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="page-wrapper">
|
|
<div id="content-wrapper">
|
|
{% include "partial/_navbar.html" %}
|
|
|
|
<section id="content">
|
|
<div class="grid">
|
|
<div class="grid__main" id="main">
|
|
<div class="main-section-wrapper">
|
|
<div class="entity-detail">
|
|
|
|
<a href="{{ item.cover.url }}" class="entity-detail__img-origin" target="_blank" title="{% trans '查看原图' %}">
|
|
<img src="{{ item.cover|thumb:'normal' }}" class="entity-detail__img" alt="{{ item.title }}">
|
|
</a>
|
|
|
|
<div class="entity-detail__info">
|
|
{% block title %}
|
|
<h5 class="entity-detail__title">
|
|
{{ item.title }}
|
|
|
|
{% for res in item.external_resources.all %}
|
|
<a href="{{ res.url }}">
|
|
<span class="source-label source-label__{{ res.site_name }}">{{ res.site_name.label }}</span>
|
|
</a>
|
|
{% endfor %}
|
|
</h5>
|
|
{% endblock %}
|
|
|
|
{% block details %}
|
|
<div class="entity-detail__fields">
|
|
<div class="entity-detail__rating">
|
|
{% if item.rating %}
|
|
<span class="entity-detail__rating-star rating-star" data-rating-score="{{ item.rating | floatformat:"0" }}"></span>
|
|
<span class="entity-detail__rating-score"> {{ item.rating }} </span>
|
|
<small>({{ item.rating_count }}人评分)</small>
|
|
{% else %}
|
|
<span> {% trans '评分:评分人数不足' %}</span>
|
|
{% endif %}
|
|
</div>
|
|
<div>uid: {{item.url_id}}</div>
|
|
<div>class: {{item.class_name}}</div>
|
|
<div>category: {{item.category}}</div>
|
|
<div>id type: {{item.primary_id_type}}</div>
|
|
<div>id value: {{item.primary_id_value}</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
<div class="tag-collection">
|
|
{% for tag in item.tags %}
|
|
<span class="tag-collection__tag">
|
|
<a href="{% url 'common:search' %}?tag={{ tag }}">{{ tag }}</a>
|
|
</span>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="dividing-line"></div>
|
|
{% if item.brief %}
|
|
<div class="entity-desc" id="description">
|
|
<h5 class="entity-desc__title">{% trans '简介' %}</h5>
|
|
|
|
<p class="entity-desc__content">{{ item.brief | linebreaksbr }}</p>
|
|
<div class="entity-desc__unfold-button entity-desc__unfold-button--hidden">
|
|
<a href="javascript:void(0);">展开全部</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if item.contents %}
|
|
<div class="entity-desc" id="contents">
|
|
<h5 class="entity-desc__title">{% trans '目录' %}</h5>
|
|
<p class="entity-desc__content">{{ item.contents | linebreaksbr }}</p>
|
|
<div class="entity-desc__unfold-button entity-desc__unfold-button--hidden">
|
|
<a href="javascript:void(0);">展开全部</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if item.track_list %}
|
|
<div class="entity-desc" id="description">
|
|
<h5 class="entity-desc__title">{% trans '曲目' %}</h5>
|
|
<p class="entity-desc__content">{{ item.track_list | linebreaksbr }}</p>
|
|
<div class="entity-desc__unfold-button entity-desc__unfold-button--hidden">
|
|
<a href="javascript:void(0);">展开全部</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="entity-marks">
|
|
<h5 class="entity-marks__title">{% trans '标记' %}</h5>
|
|
<a href="{% url 'books:retrieve_mark_list' item.id %}" class="entity-marks__more-link">{% trans '全部标记' %}</a>
|
|
<a href="{% url 'books:retrieve_mark_list' item.id 1 %}" class="entity-marks__more-link">关注的人的标记</a>
|
|
{% include "partial/mark_list.html" with mark_list=mark_list current_item=book %}
|
|
</div>
|
|
<div class="entity-reviews">
|
|
<h5 class="entity-reviews__title">{% trans '评论' %}</h5>
|
|
{% if review_list_more %}
|
|
<a href="{% url 'books:retrieve_review_list' item.id %}" class="entity-reviews__more-link">{% trans '全部评论' %}</a>
|
|
{% endif %}
|
|
{% if review_list %}
|
|
<ul class="entity-reviews__review-list">
|
|
{% for others_review in review_list %}
|
|
<li class="entity-reviews__review">
|
|
<a href="{% url 'users:home' others_review.owner.mastodon_username %}" class="entity-reviews__owner-link">{{ others_review.owner.username }}</a>
|
|
{% if others_review.visibility > 0 %}
|
|
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
|
{% endif %}
|
|
<span class="entity-reviews__review-time">{{ others_review.edited_time }}</span>
|
|
{% if others_review.book != book %}
|
|
<span class="entity-reviews__review-time source-label"><a class="entity-reviews__review-time" href="{% url 'books:retrieve' others_review.item.id %}">{{ others_review.item.get_source_site_display }}</a></span>
|
|
{% endif %}
|
|
<span class="entity-reviews__review-title"> <a href="{% url 'books:retrieve_review' others_review.id %}">{{ others_review.title }}</a></span>
|
|
<span>{{ others_review.get_plain_content | truncate:100 }}</span>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<div>{% trans '暂无评论' %}</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid__aside" id="aside">
|
|
{% block sidebar_review %}
|
|
<div class="aside-section-wrapper">
|
|
{% if mark.shelf_type %}
|
|
<div class="mark-panel">
|
|
<span class="mark-panel__status">{% trans '我' %}{% trans mark.shelf_label %}</span>
|
|
{% if mark.rating %}
|
|
<span class="mark-panel__rating-star rating-star" data-rating-score="{{ mark.rating | floatformat:"0" }}"></span>
|
|
{% endif %}
|
|
{% if mark.visibility > 0 %}
|
|
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
|
{% endif %}
|
|
<span class="mark-panel__actions">
|
|
<a href="" class="edit">{% trans '修改' %}</a>
|
|
<form action="{% url 'books:delete_mark' mark.id %}" method="post">
|
|
{% csrf_token %}
|
|
<a href="" class="delete">{% trans '删除' %}</a>
|
|
</form>
|
|
</span>
|
|
<div class="mark-panel__clear"></div>
|
|
|
|
<div class="mark-panel__time">{{ mark.created_time }}</div>
|
|
|
|
{% if mark.text %}
|
|
<p class="mark-panel__text">{{ mark.text }}</p>
|
|
{% endif %}
|
|
<div class="tag-collection">
|
|
|
|
{% for tag in mark.tags %}
|
|
<span class="tag-collection__tag">{{ tag }}</span>
|
|
{% endfor %}
|
|
|
|
</div>
|
|
</div>
|
|
{% else %}
|
|
<div class="action-panel" id="addMarkPanel">
|
|
<div class="action-panel__label">{% trans '标记' %}{% trans item.demonstrative %}</div>
|
|
<div class="action-panel__button-group">
|
|
<button class="action-panel__button" data-status="{{ status_enum.WISH.value }}" id="wishButton">{% trans '想读' %}</button>
|
|
<button class="action-panel__button" data-status="{{ status_enum.DO.value }}">{% trans '在读' %}</button>
|
|
<button class="action-panel__button" data-status="{{ status_enum.COLLECT.value }}">{% trans '读过' %}</button>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="aside-section-wrapper">
|
|
{% if review %}
|
|
<div class="review-panel">
|
|
|
|
<span class="review-panel__label">{% trans '我的评论' %}</span>
|
|
{% if review.visibility > 0 %}
|
|
<span class="icon-lock"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M17,8.48h-.73V6.27a6.27,6.27,0,1,0-12.53,0V8.48H3a.67.67,0,0,0-.67.67V19.33A.67.67,0,0,0,3,20H17a.67.67,0,0,0,.67-.67V9.15A.67.67,0,0,0,17,8.48ZM6.42,6.27h0a3.57,3.57,0,0,1,7.14,0h0V8.48H6.42Z"/></svg></span>
|
|
{% endif %}
|
|
|
|
<span class="review-panel__actions">
|
|
<a href="{% url 'books:update_review' review.id %}">{% trans '编辑' %}</a>
|
|
<a href="{% url 'books:delete_review' review.id %}">{% trans '删除' %}</a>
|
|
</span>
|
|
|
|
<div class="review-panel__time">{{ review.edited_time }}</div>
|
|
|
|
<a href="{% url 'books:retrieve_review' review.id %}" class="review-panel__review-title">
|
|
{{ review.title }}
|
|
</a>
|
|
</div>
|
|
{% else %}
|
|
|
|
<div class="action-panel">
|
|
<div class="action-panel__label">{% trans '我的评论' %}</div>
|
|
<div class="action-panel__button-group action-panel__button-group--center">
|
|
|
|
<a href="{% url 'books:create_review' item.id %}">
|
|
<button class="action-panel__button">{% trans '去写评论' %}</button>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block sidebar %}
|
|
{% endblock %}
|
|
|
|
{% block sidebar_collection %}
|
|
{% if collection_list %}
|
|
<div class="aside-section-wrapper">
|
|
<div class="action-panel">
|
|
<div class="action-panel__label">{% trans '相关收藏单' %}</div>
|
|
<div >
|
|
{% for c in collection_list %}
|
|
<p>
|
|
<a href="{% url 'collection:retrieve' c.id %}">{{ c.title }}</a>
|
|
</p>
|
|
{% endfor %}
|
|
<div class="action-panel__button-group action-panel__button-group--center">
|
|
<button class="action-panel__button add-to-list" hx-get="{% url 'collection:add_to_list' 'book' item.id %}" hx-target="body" hx-swap="beforeend">{% trans '添加到收藏单' %}</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
{% include "partial/_footer.html" %}
|
|
</div>
|
|
|
|
<div id="modals">
|
|
<div class="mark-modal modal">
|
|
<div class="mark-modal__head">
|
|
{% if not mark %}
|
|
<style>
|
|
.mark-modal__title::after {
|
|
content: "{% trans item.demonstrative %}";
|
|
}
|
|
</style>
|
|
<span class="mark-modal__title"></span>
|
|
{% else %}
|
|
<span class="mark-modal__title">{% trans '我的标记' %}</span>
|
|
{% endif %}
|
|
|
|
<span class="mark-modal__close-button modal-close">
|
|
<span class="icon-cross">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
|
<polygon
|
|
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
|
</polygon>
|
|
</svg>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
<div class="mark-modal__body">
|
|
<form action="{% url 'books:create_update_mark' %}" method="post">
|
|
{{ mark_form.media }}
|
|
{% csrf_token %}
|
|
{{ mark_form.id }}
|
|
{{ mark_form.book }}
|
|
{% if mark.rating %}
|
|
{% endif %}
|
|
|
|
<div class="mark-modal__rating-star rating-star-edit"></div>
|
|
{{ mark_form.rating }}
|
|
<div id="statusSelection" class="mark-modal__status-radio" {% if not mark %}hidden{% endif %}>
|
|
{{ mark_form.status }}
|
|
</div>
|
|
|
|
<div class="mark-modal__clear"></div>
|
|
|
|
{{ mark_form.text }}
|
|
|
|
<div class="mark-modal__tag">
|
|
<label>{{ mark_form.tags.label }}</label>
|
|
{{ mark_form.tags }}
|
|
</div>
|
|
|
|
<div class="mark-modal__option">
|
|
<div class="mark-modal__visibility-radio">
|
|
<span>{{ mark_form.visibility.label }}:
|
|
{{ mark_form.visibility }}</span>
|
|
</div>
|
|
<div class="mark-modal__share-checkbox">
|
|
{{ mark_form.share_to_mastodon }}{{ mark_form.share_to_mastodon.label }}
|
|
</div>
|
|
</div>
|
|
<div class="mark-modal__confirm-button">
|
|
<input type="submit" class="button float-right" value="{% trans '提交' %}">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="confirm-modal modal">
|
|
<div class="confirm-modal__head">
|
|
<span class="confirm-modal__title">{% trans '确定要删除你的标记吗?' %}</span>
|
|
<span class="confirm-modal__close-button modal-close">
|
|
<span class="icon-cross">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
|
<polygon
|
|
points="20 2.61 17.39 0 10 7.39 2.61 0 0 2.61 7.39 10 0 17.39 2.61 20 10 12.61 17.39 20 20 17.39 12.61 10 20 2.61">
|
|
</polygon>
|
|
</svg>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
<div class="confirm-modal__body">
|
|
<div class="confirm-modal__confirm-button">
|
|
<input type="submit" class="button float-right" value="{% trans '确认' %}">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="bg-mask"></div>
|
|
|
|
<script>
|
|
|
|
</script>
|
|
</body>
|
|
|
|
|
|
</html>
|