Skip to content

Commit

Permalink
Always expand content status on single status view
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chdorner committed Feb 4, 2023
1 parent d94b9f9 commit 6af1be2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bookwyrm/templates/feed/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{% endif %}
{% endfor %}
<div class="is-main block">
{% include 'snippets/status/status.html' with status=status main=True %}
{% include 'snippets/status/status.html' with status=status main=True expand=True %}
</div>

{% for child in children %}
Expand Down
3 changes: 1 addition & 2 deletions bookwyrm/templates/snippets/status/body.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

3 changes: 1 addition & 2 deletions bookwyrm/templates/snippets/status/content_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h4 class="subtitle is-6">
{% 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 %}
Expand Down Expand Up @@ -155,4 +155,3 @@ <h4 class="subtitle is-6">
</div>

{% endwith %}

2 changes: 1 addition & 1 deletion bookwyrm/templates/snippets/status/status.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}

0 comments on commit 6af1be2

Please sign in to comment.