Trims status text

This commit is contained in:
Mouse Reeve
2021-08-07 15:51:53 -07:00
parent 760bd5a63f
commit 650a6037a2
2 changed files with 13 additions and 3 deletions

View File

@ -3,20 +3,24 @@
{% load i18n %}
{% with 0|uuid as uuid %}
{% firstof trim_length 150 as trim_length %}
{% if full %}
{% with full|to_markdown|safe as full %}
{% with full|to_markdown|safe|truncatewords_html:150 as trimmed %}
{% with full|to_markdown|safe|truncatewords_html:trim_length as trimmed %}
{% if not no_trim and trimmed != full %}
<div id="hide-full-{{ uuid }}">
<div class="content" id="trimmed-{{ uuid }}">
<div dir="auto">{{ trimmed }}</div>
<div>
{% if not hide_more %}
{% trans "Show more" as button_text %}
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
{% endif %}
</div>
</div>
</div>
{% if not hide_more %}
<div id="full-{{ uuid }}" class="is-hidden">
<div class="content">
<div
@ -32,6 +36,7 @@
</div>
</div>
</div>
{% endif %}
{% else %}
<div class="content">
<div