moviewyrm/bookwyrm/templates/snippets/status/content_status.html

141 lines
5.7 KiB
HTML
Raw Normal View History

2021-04-20 16:54:02 +00:00
{% load bookwyrm_tags %}
2021-05-11 22:14:42 +00:00
{% load markdown %}
2021-04-20 16:54:02 +00:00
{% load i18n %}
2021-06-07 16:13:24 +00:00
{% load static %}
2021-04-20 16:54:02 +00:00
{% with status_type=status.status_type %}
<div
class="block"
2021-04-20 18:06:14 +00:00
{% if status_type == "Review" %}
itemprop="rating"
itemtype="https://schema.org/Rating"
{% endif %}
2021-04-20 16:54:02 +00:00
>
<div class="columns is-gapless">
2021-04-20 18:06:14 +00:00
{% if not hide_book %}
{% with book=status.book|default:status.mention_books.first %}
{% if book %}
<div class="column is-cover">
<div class="columns is-mobile is-gapless">
<div class="column is-cover">
2021-05-24 14:18:05 +00:00
<a href="{{ book.local_path }}">{% include 'snippets/book_cover.html' with book=book cover_class='is-w-s-mobile is-h-l-tablet' size_mobile='medium' size='large' %}</a>
{% include 'snippets/stars.html' with rating=book|rating:request.user %}
{% include 'snippets/shelve_button/shelve_button.html' with book=book %}
</div>
<div class="column ml-3-mobile is-hidden-tablet">
<p>{{ book|book_description|to_markdown|default:""|safe|truncatewords_html:15 }}</p>
</div>
</div>
</div>
{% endif %}
{% endwith %}
2021-04-20 16:54:02 +00:00
{% endif %}
<article class="column ml-3-tablet my-3-mobile">
2021-04-20 18:06:14 +00:00
{% if status_type == 'Review' %}
<header class="mb-2">
<h3
class="title is-5 has-subtitle"
dir="auto"
itemprop="name"
>
{{ status.name|escape }}
</h3>
<h4 class="subtitle is-6">
<span
class="is-hidden"
{% if status_type == "Review" %}
itemprop="reviewRating"
itemscope
itemtype="https://schema.org/Rating"
{% endif %}
>
<meta itemprop="ratingValue" content="{{ status.rating|floatformat }}">
{# @todo Is it possible to not hard-code the value? #}
<meta itemprop="bestRating" content="5">
</span>
{% include 'snippets/stars.html' with rating=status.rating %}
</h4>
</header>
2021-04-20 16:54:02 +00:00
{% endif %}
2021-04-20 18:06:14 +00:00
{% if status.content_warning %}
<div>
<p>{{ status.content_warning }}</p>
2021-04-20 16:54:02 +00:00
2021-04-20 18:06:14 +00:00
{% trans "Show more" as button_text %}
2021-04-20 16:54:02 +00:00
{% with text=button_text class="is-small" controls_text="show_status_cw" controls_uid=status.id %}
2021-04-20 18:06:14 +00:00
{% include 'snippets/toggle/open_button.html' %}
{% endwith %}
2021-04-20 16:54:02 +00:00
</div>
{% endif %}
2021-04-20 18:06:14 +00:00
<div
{% if status.content_warning %}
id="show_status_cw_{{ status.id }}"
2021-04-20 18:06:14 +00:00
class="is-hidden"
{% endif %}
>
{% if status.content_warning %}
{% trans "Show less" as button_text %}
{% with text=button_text class="is-small" controls_text="show_status_cw" controls_uid=status.id %}
2021-04-20 18:06:14 +00:00
{% include 'snippets/toggle/close_button.html' %}
{% endwith %}
{% endif %}
2021-04-20 16:54:02 +00:00
2021-04-20 18:06:14 +00:00
{% if status.quote %}
<div class="quote block">
<blockquote dir="auto" class="content mb-2">{{ status.quote|safe }}</blockquote>
2021-04-20 18:06:14 +00:00
<p> &mdash; {% include 'snippets/book_titleby.html' with book=status.book %}</p>
</div>
{% endif %}
{% if status.content and status_type != 'GeneratedNote' and status_type != 'Announce' %}
{% with full=status.content|safe no_trim=status.content_warning itemprop="reviewBody" %}
{% include 'snippets/trimmed_text.html' %}
{% endwith %}
{% endif %}
{% if status.attachments.exists %}
<div class="block">
<div class="columns">
{% for attachment in status.attachments.all %}
<div class="column is-narrow">
<figure class="image is-128x128">
<a
2021-06-07 16:13:24 +00:00
href="{% get_media_prefix %}{{ attachment.image }}"
2021-04-20 18:06:14 +00:00
target="_blank"
aria-label="{% trans 'Open image in new window' %}"
2021-04-20 16:54:02 +00:00
>
2021-04-20 18:06:14 +00:00
<img
2021-06-07 16:13:24 +00:00
src="{% get_media_prefix %}{{ attachment.image }}"
2021-04-20 18:06:14 +00:00
{% if attachment.caption %}
alt="{{ attachment.caption }}"
title="{{ attachment.caption }}"
{% endif %}
>
</a>
</figure>
</div>
{% endfor %}
</div>
2021-04-20 16:54:02 +00:00
</div>
2021-04-20 18:06:14 +00:00
{% endif %}
</div>
</article>
</div>
2021-04-20 16:54:02 +00:00
</div>
{% endwith %}