Merge branch 'main' into images-django-imagekit
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
{% block card-content %}
|
||||
{% with status_type=status.status_type %}
|
||||
|
||||
{% if status_type == 'GeneratedNote' or status_type == 'Rating' %}
|
||||
{% if status_type == 'GeneratedNote' or status_type == 'Rating' or not status.content %}
|
||||
{% include 'snippets/status/generated_status.html' with status=status %}
|
||||
{% else %}
|
||||
{% include 'snippets/status/content_status.html' with status=status %}
|
@ -71,7 +71,7 @@
|
||||
|
||||
{% trans "Show more" as button_text %}
|
||||
|
||||
{% with text=button_text class="is-small" controls_text="show-status-cw" controls_uid=status.id %}
|
||||
{% with text=button_text class="is-small" controls_text="show_status_cw" controls_uid=status.id %}
|
||||
{% include 'snippets/toggle/open_button.html' %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
@ -79,21 +79,21 @@
|
||||
|
||||
<div
|
||||
{% if status.content_warning %}
|
||||
id="show-status-cw-{{ status.id }}"
|
||||
id="show_status_cw_{{ status.id }}"
|
||||
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 %}
|
||||
{% with text=button_text class="is-small" controls_text="show_status_cw" controls_uid=status.id %}
|
||||
{% include 'snippets/toggle/close_button.html' %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.quote %}
|
||||
<div class="quote block">
|
||||
<blockquote dir="auto" class="content mb-2">{{ status.quote | safe }}</blockquote>
|
||||
<blockquote dir="auto" class="content mb-2">{{ status.quote|safe }}</blockquote>
|
||||
|
||||
<p> — {% include 'snippets/book_titleby.html' with book=status.book %}</p>
|
||||
</div>
|
||||
|
48
bookwyrm/templates/snippets/status/header.html
Normal file
48
bookwyrm/templates/snippets/status/header.html
Normal file
@ -0,0 +1,48 @@
|
||||
{% load utilities %}
|
||||
{% load status_display %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
|
||||
<div class="media">
|
||||
<figure class="media-left" aria-hidden="true">
|
||||
<a class="image is-48x48" href="{{ status.user.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=status.user ariaHide="true" medium="true" %}
|
||||
</a>
|
||||
</figure>
|
||||
|
||||
<div class="media-content">
|
||||
<h3 class="has-text-weight-bold">
|
||||
<span
|
||||
itemprop="author"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Person"
|
||||
>
|
||||
{% if status.user.avatar %}
|
||||
<meta itemprop="image" content="/images/{{ status.user.avatar }}">
|
||||
{% endif %}
|
||||
|
||||
<a
|
||||
href="{{ status.user.local_path }}"
|
||||
itemprop="url"
|
||||
>
|
||||
<span itemprop="name">{{ status.user.display_name }}</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
{% include "snippets/status/header_content.html" %}
|
||||
</h3>
|
||||
<p class="is-size-7 is-flex is-align-items-center">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date|published_date }}</a>
|
||||
{% if status.progress %}
|
||||
<span class="ml-1">
|
||||
{% if status.progress_mode == 'PG' %}
|
||||
({% include 'snippets/page_text.html' with page=status.progress total_pages=status.book.pages %})
|
||||
{% else %}
|
||||
({{ status.progress }}%)
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% include 'snippets/privacy-icons.html' with item=status %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
4
bookwyrm/templates/snippets/status/header_content.html
Normal file
4
bookwyrm/templates/snippets/status/header_content.html
Normal file
@ -0,0 +1,4 @@
|
||||
{% spaceless %}
|
||||
{% load status_display %}
|
||||
{% get_header_template status %}
|
||||
{% endspaceless %}
|
2
bookwyrm/templates/snippets/status/headers/comment.html
Normal file
2
bookwyrm/templates/snippets/status/headers/comment.html
Normal file
@ -0,0 +1,2 @@
|
||||
{% load i18n %}{% load utilities %}
|
||||
{% blocktrans with book_path=book.local_path book=status.book|book_title %}commented on <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
5
bookwyrm/templates/snippets/status/headers/goal.html
Normal file
5
bookwyrm/templates/snippets/status/headers/goal.html
Normal file
@ -0,0 +1,5 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}{% load humanize %}
|
||||
|
||||
{{ status.content }}
|
||||
{% endspaceless %}
|
22
bookwyrm/templates/snippets/status/headers/note.html
Normal file
22
bookwyrm/templates/snippets/status/headers/note.html
Normal file
@ -0,0 +1,22 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}
|
||||
{% load status_display %}
|
||||
{% load utilities %}
|
||||
|
||||
{% if status.status_type == 'GeneratedNote' %}
|
||||
{% with book=status.mention_books.first %}
|
||||
{{ status.content|safe }} <a href="{{ book.local_path }}">{{ book|book_title }}</a>
|
||||
{% endwith %}
|
||||
|
||||
{% else %}
|
||||
|
||||
{% with parent_status=status|parent %}
|
||||
{% if parent_status %}
|
||||
{% blocktrans trimmed with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}
|
||||
replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">status</a>
|
||||
{% endblocktrans %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
{% endif %}
|
||||
{% endspaceless %}
|
@ -0,0 +1,2 @@
|
||||
{% load i18n %}{% load utilities %}
|
||||
{% blocktrans with book_path=status.book.local_path book=status.book|book_title %}quoted <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
25
bookwyrm/templates/snippets/status/headers/rating.html
Normal file
25
bookwyrm/templates/snippets/status/headers/rating.html
Normal file
@ -0,0 +1,25 @@
|
||||
{% load i18n %}{% load utilities %}
|
||||
|
||||
{% blocktrans with book_path=status.book.local_path book=status.book|book_title %}rated <a href="{{ book_path }}">{{ book }}</a>:{% endblocktrans %} {% include 'snippets/stars.html' with rating=status.rating %}
|
||||
<span
|
||||
itemprop="reviewRating"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Rating"
|
||||
>
|
||||
<span class="is-hidden" {{ rating_type }}>
|
||||
<meta itemprop="ratingValue" content="{{ status.rating|floatformat }}">
|
||||
|
||||
<span
|
||||
itemprop="reviewRating"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Rating"
|
||||
>
|
||||
<span class="is-hidden" {{ rating_type }}>
|
||||
<meta itemprop="ratingValue" content="{{ status.rating|floatformat }}">
|
||||
|
||||
{# @todo Is it possible to not hard-code the value? #}
|
||||
<meta itemprop="bestRating" content="5">
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
7
bookwyrm/templates/snippets/status/headers/read.html
Normal file
7
bookwyrm/templates/snippets/status/headers/read.html
Normal file
@ -0,0 +1,7 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}{% load utilities %}
|
||||
|
||||
{% with book=status.mention_books.first %}
|
||||
{% blocktrans with book_path=book.remote_id book=book|book_title %}finished reading <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% endspaceless %}
|
9
bookwyrm/templates/snippets/status/headers/reading.html
Normal file
9
bookwyrm/templates/snippets/status/headers/reading.html
Normal file
@ -0,0 +1,9 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% with book=status.mention_books.first %}
|
||||
{% blocktrans with book_path=book.remote_id book=book|book_title %}started reading <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
||||
{% endwith %}
|
||||
|
||||
{% endspaceless %}
|
3
bookwyrm/templates/snippets/status/headers/review.html
Normal file
3
bookwyrm/templates/snippets/status/headers/review.html
Normal file
@ -0,0 +1,3 @@
|
||||
{% load i18n %}{% load utilities %}
|
||||
|
||||
{% blocktrans with book_path=status.book.local_path book=status.book|book_title %}reviewed <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
8
bookwyrm/templates/snippets/status/headers/to_read.html
Normal file
8
bookwyrm/templates/snippets/status/headers/to_read.html
Normal file
@ -0,0 +1,8 @@
|
||||
{% spaceless %}
|
||||
{% load i18n %}
|
||||
{% load utilities %}
|
||||
|
||||
{% with book=status.mention_books.first %}
|
||||
{% blocktrans with book_path=book.remote_id book=book|book_title %}<a href="{{ user_path }}">{{ username }}</a> wants to read <a href="{{ book_path }}">{{ book }}</a>{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% endspaceless %}
|
@ -4,7 +4,7 @@
|
||||
|
||||
{% block card-header %}
|
||||
<div class="card-header-title has-background-white-ter is-block">
|
||||
{% include 'snippets/status/status_header.html' with status=status %}
|
||||
{% include 'snippets/status/header.html' with status=status %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@ -12,8 +12,8 @@
|
||||
|
||||
{% block card-footer %}
|
||||
{% if moderation_mode and perms.bookwyrm.moderate_post %}
|
||||
<div class="card-footer-item">
|
||||
|
||||
<div class="card-footer-item">
|
||||
{# moderation options #}
|
||||
<form name="delete-{{ status.id }}" action="/delete-status/{{ status.id }}" method="post">
|
||||
{% csrf_token %}
|
||||
@ -22,12 +22,14 @@
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% elif no_interact %}
|
||||
{# nothing here #}
|
||||
{% elif request.user.is_authenticated %}
|
||||
|
||||
<div class="card-footer-item">
|
||||
{% trans "Reply" as button_text %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show-comment" controls_uid=status.id text=button_text icon_with_text="comment" class="is-small is-light is-transparent toggle-button" focus="id_content_reply" %}
|
||||
{% include 'snippets/toggle/toggle_button.html' with controls_text="show_comment" controls_uid=status.id text=button_text icon_with_text="comment" class="is-small is-light is-transparent toggle-button" focus="id_content_reply" %}
|
||||
</div>
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/boost_button.html' with status=status %}
|
||||
@ -57,16 +59,17 @@
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block card-bonus %}
|
||||
{% if request.user.is_authenticated and not moderation_mode %}
|
||||
{% with status.id|uuid as uuid %}
|
||||
<section class="is-hidden" id="show-comment-{{ status.id }}">
|
||||
<section class="is-hidden" id="show_comment_{{ status.id }}">
|
||||
<div class="card-footer">
|
||||
<div class="card-footer-item">
|
||||
{% include 'snippets/create_status_form.html' with reply_parent=status type="reply" %}
|
||||
{% include 'snippets/create_status/status.html' with type="reply" reply_parent=status book=None %}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
@ -8,8 +8,8 @@
|
||||
{{ status.user.display_name }}
|
||||
</a>
|
||||
{% trans "boosted" %}
|
||||
{% include 'snippets/status/status_body.html' with status=status|boosted_status %}
|
||||
{% include 'snippets/status/body.html' with status=status|boosted_status %}
|
||||
{% else %}
|
||||
{% include 'snippets/status/status_body.html' with status=status %}
|
||||
{% include 'snippets/status/body.html' with status=status %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@ -1,109 +0,0 @@
|
||||
{% load utilities %}
|
||||
{% load status_display %}
|
||||
{% load i18n %}
|
||||
{% load humanize %}
|
||||
{% load static %}
|
||||
|
||||
<div class="media">
|
||||
<figure class="media-left" aria-hidden="true">
|
||||
<a class="image is-48x48" href="{{ status.user.local_path }}">
|
||||
{% include 'snippets/avatar.html' with user=status.user ariaHide="true" medium="true" %}
|
||||
</a>
|
||||
</figure>
|
||||
|
||||
<div class="media-content">
|
||||
<h3 class="has-text-weight-bold">
|
||||
<span
|
||||
itemprop="author"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Person"
|
||||
>
|
||||
{% if status.user.avatar %}
|
||||
<meta itemprop="image" content="{% get_media_prefix %}{{ status.user.avatar }}">
|
||||
{% endif %}
|
||||
|
||||
<a
|
||||
href="{{ status.user.local_path }}"
|
||||
itemprop="url"
|
||||
>
|
||||
<span itemprop="name">{{ status.user.display_name }}</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
{% if status.status_type == 'GeneratedNote' %}
|
||||
{{ status.content|safe }}
|
||||
{% elif status.status_type == 'Rating' %}
|
||||
{% trans "rated" %}
|
||||
{% elif status.status_type == 'Review' %}
|
||||
{% trans "reviewed" %}
|
||||
{% elif status.status_type == 'Comment' %}
|
||||
{% trans "commented on" %}
|
||||
{% elif status.status_type == 'Quotation' %}
|
||||
{% trans "quoted" %}
|
||||
{% elif status.reply_parent %}
|
||||
{% with parent_status=status|parent %}
|
||||
|
||||
{% blocktrans with username=parent_status.user.display_name user_path=parent_status.user.local_path status_path=parent_status.local_path %}replied to <a href="{{ user_path }}">{{ username}}'s</a> <a href="{{ status_path }}">status</a>{% endblocktrans %}
|
||||
{% endwith %}
|
||||
{% endif %}
|
||||
|
||||
{% if status.book %}
|
||||
{% if status.status_type == 'GeneratedNote' or status.status_type == 'Rating' %}
|
||||
<a href="{{ status.book.local_path }}">{{ status.book|book_title }}</a>{% if status.status_type == 'Rating' %}: {% include 'snippets/stars.html' with rating=status.rating %}
|
||||
<span
|
||||
itemprop="reviewRating"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Rating"
|
||||
>
|
||||
<span class="is-hidden" {{ rating_type }}>
|
||||
<meta itemprop="ratingValue" content="{{ status.rating|floatformat }}">
|
||||
|
||||
{% if status.book %}
|
||||
{% if status.status_type == 'GeneratedNote' or status.status_type == 'Rating' %}
|
||||
<a href="{{ status.book.local_path }}">{{ status.book|book_title }}</a>{% if status.status_type == 'Rating' %}:
|
||||
<span
|
||||
itemprop="reviewRating"
|
||||
itemscope
|
||||
itemtype="https://schema.org/Rating"
|
||||
>
|
||||
<span class="is-hidden" {{ rating_type }}>
|
||||
<meta itemprop="ratingValue" content="{{ status.rating|floatformat }}">
|
||||
|
||||
{# @todo Is it possible to not hard-code the value? #}
|
||||
<meta itemprop="bestRating" content="5">
|
||||
</span>
|
||||
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include 'snippets/book_titleby.html' with book=status.book %}
|
||||
{% endif %}
|
||||
{% elif status.mention_books %}
|
||||
<a href="{{ status.mention_books.first.local_path }}">
|
||||
{{ status.mention_books.first|book_title }}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% include 'snippets/stars.html' with rating=status.rating %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% include 'snippets/book_titleby.html' with book=status.book %}
|
||||
{% endif %}
|
||||
{% elif status.mention_books %}
|
||||
<a href="{{ status.mention_books.first.local_path }}">{{ status.mention_books.first|book_title }}</a>
|
||||
{% endif %}
|
||||
|
||||
</h3>
|
||||
<p class="is-size-7 is-flex is-align-items-center">
|
||||
<a href="{{ status.remote_id }}">{{ status.published_date|published_date }}</a>
|
||||
{% if status.progress %}
|
||||
<span class="ml-1">
|
||||
{% if status.progress_mode == 'PG' %}
|
||||
({% include 'snippets/page_text.html' with page=status.progress total_pages=status.book.pages %})
|
||||
{% else %}
|
||||
({{ status.progress }}%)
|
||||
{% endif %}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% include 'snippets/privacy-icons.html' with item=status %}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user