moviewyrm/bookwyrm/templates/snippets/trimmed_text.html

31 lines
978 B
HTML
Raw Normal View History

2020-12-13 02:25:04 +00:00
{% load bookwyrm_tags %}
{% load i18n %}
2020-11-12 19:40:20 +00:00
{% with 0|uuid as uuid %}
{% if full %}
2021-01-31 16:41:11 +00:00
{% with full|to_markdown|safe as full %}
2020-11-12 19:40:20 +00:00
{% with full|to_markdown|safe|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 }}">
2021-01-31 16:41:11 +00:00
<div class="content" id="trimmed-{{ uuid }}"><span dir="auto">{{ trimmed }}</span>
{% 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" %}
2021-01-31 16:41:11 +00:00
</div>
2020-11-12 19:40:20 +00:00
</div>
2021-01-17 18:38:34 +00:00
<div id="full-{{ uuid }}" class="hidden">
2021-01-31 16:41:11 +00:00
<div class="content"><span dir="auto">{{ full }}</span>
{% trans "Show less" as button_text %}
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
2021-01-31 16:41:11 +00:00
</div>
2020-11-12 19:40:20 +00:00
</div>
{% else %}
2021-01-31 16:41:11 +00:00
<div class="content"><span dir="auto">{{ full }}</span></div>
2020-11-12 19:40:20 +00:00
{% endif %}
{% endwith %}
2021-01-31 16:41:11 +00:00
{% endwith %}
2020-11-12 19:40:20 +00:00
{% endif %}
{% endwith %}