From 6af1be28f3aa2bbee4cb95a816677ebf49d57274 Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Sat, 4 Feb 2023 12:50:10 +0100 Subject: [PATCH] Always expand content status on single status view On the feed view along with other statuses, the body will be trimmed, but on the single view, there's no need to trim it. This preserves the logic for spoiler alerts. --- bookwyrm/templates/feed/status.html | 2 +- bookwyrm/templates/snippets/status/body.html | 3 +-- bookwyrm/templates/snippets/status/content_status.html | 3 +-- bookwyrm/templates/snippets/status/status.html | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bookwyrm/templates/feed/status.html b/bookwyrm/templates/feed/status.html index ccec6503c..c05d2ba46 100644 --- a/bookwyrm/templates/feed/status.html +++ b/bookwyrm/templates/feed/status.html @@ -30,7 +30,7 @@ {% endif %} {% endfor %}
- {% include 'snippets/status/status.html' with status=status main=True %} + {% include 'snippets/status/status.html' with status=status main=True expand=True %}
{% for child in children %} diff --git a/bookwyrm/templates/snippets/status/body.html b/bookwyrm/templates/snippets/status/body.html index 2c8a0e045..cd3b3cd43 100644 --- a/bookwyrm/templates/snippets/status/body.html +++ b/bookwyrm/templates/snippets/status/body.html @@ -6,9 +6,8 @@ {% if status_type == 'GeneratedNote' or status_type == 'Rating' %} {% include 'snippets/status/generated_status.html' with status=status %} {% else %} - {% include 'snippets/status/content_status.html' with status=status %} + {% include 'snippets/status/content_status.html' with status=status expand=expand %} {% endif %} {% endwith %} {% endblock %} - diff --git a/bookwyrm/templates/snippets/status/content_status.html b/bookwyrm/templates/snippets/status/content_status.html index e39284fcf..b8c719ec0 100644 --- a/bookwyrm/templates/snippets/status/content_status.html +++ b/bookwyrm/templates/snippets/status/content_status.html @@ -109,7 +109,7 @@ {% endif %} {% if status.content and status_type != 'GeneratedNote' and status_type != 'Announce' %} - {% with full=status.content|safe no_trim=status.content_warning itemprop="reviewBody" %} + {% with full=status.content|safe no_trim=status.content_warning|default:expand itemprop="reviewBody" %} {% include 'snippets/trimmed_text.html' %} {% endwith %} {% endif %} @@ -155,4 +155,3 @@ {% endwith %} - diff --git a/bookwyrm/templates/snippets/status/status.html b/bookwyrm/templates/snippets/status/status.html index eb0c409eb..a04b76700 100644 --- a/bookwyrm/templates/snippets/status/status.html +++ b/bookwyrm/templates/snippets/status/status.html @@ -10,6 +10,6 @@ {% trans "boosted" %} {% include 'snippets/status/body.html' with status=status|boosted_status %} {% else %} - {% include 'snippets/status/body.html' with status=status %} + {% include 'snippets/status/body.html' with status=status expand=expand %} {% endif %} {% endif %}