moviewyrm/bookwyrm/templates/snippets/trimmed_text.html

25 lines
900 B
HTML
Raw Normal View History

2020-12-13 02:25:04 +00:00
{% load bookwyrm_tags %}
2020-11-12 19:40:20 +00:00
{% with 0|uuid as uuid %}
{% if full %}
{% with full|truncatewords_html:60 as trimmed %}
2020-11-12 19:40:20 +00:00
{% if trimmed != full %}
2021-01-17 18:38:34 +00:00
<div id="hide-full-{{ uuid }}">
<blockquote class="content" id="trimmed-{{ uuid }}"><span dir="auto">{{ trimmed | to_markdown | safe }}</span>
{% include 'snippets/toggle/open_button.html' with text="show more" controls_text="full" controls_uid=uuid class="is-small" %}
2020-11-12 19:40:20 +00:00
</blockquote>
</div>
2021-01-17 18:38:34 +00:00
<div id="full-{{ uuid }}" class="hidden">
<blockquote class="content"><span dir="auto">{{ full | to_markdown | safe }}</span>
{% include 'snippets/toggle/close_button.html' with text="show less" controls_text="full" controls_uid=uuid class="is-small" %}
2020-11-12 19:40:20 +00:00
</blockquote>
</div>
{% else %}
<blockquote class="content"><span dir="auto">{{ full | to_markdown | safe }}</span></blockquote>
2020-11-12 19:40:20 +00:00
{% endif %}
{% endwith %}
{% endif %}
{% endwith %}