forked from mirrors/bookwyrm
Trims status text
This commit is contained in:
parent
760bd5a63f
commit
650a6037a2
2 changed files with 13 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
{% load bookwyrm_tags %}
|
{% load bookwyrm_tags %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load status_display %}
|
||||||
|
|
||||||
{% if status %}
|
{% if status %}
|
||||||
{% with book=status.book %}
|
{% with book=status.book %}
|
||||||
|
@ -59,9 +60,13 @@
|
||||||
{% include 'snippets/follow_button.html' with user=status.user show_username=True minimal=True %}
|
{% include 'snippets/follow_button.html' with user=status.user show_username=True minimal=True %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="notification has-background-white p-2">
|
<div class="notification has-background-white p-2 mb-2">
|
||||||
{% include "snippets/status/content_status.html" with hide_book=True %}
|
{% include "snippets/status/content_status.html" with hide_book=True trim_length=100 hide_more=True %}
|
||||||
</div>
|
</div>
|
||||||
|
<a href="{{ status.remote_id }}">
|
||||||
|
<span>{% trans "View status" %}</span>
|
||||||
|
<span class="icon icon-arrow-right" aria-hidden="true"></span>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
|
@ -3,20 +3,24 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% with 0|uuid as uuid %}
|
{% with 0|uuid as uuid %}
|
||||||
|
{% firstof trim_length 150 as trim_length %}
|
||||||
{% if full %}
|
{% if full %}
|
||||||
{% with full|to_markdown|safe as 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 %}
|
{% if not no_trim and trimmed != full %}
|
||||||
<div id="hide-full-{{ uuid }}">
|
<div id="hide-full-{{ uuid }}">
|
||||||
<div class="content" id="trimmed-{{ uuid }}">
|
<div class="content" id="trimmed-{{ uuid }}">
|
||||||
<div dir="auto">{{ trimmed }}</div>
|
<div dir="auto">{{ trimmed }}</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
|
{% if not hide_more %}
|
||||||
{% trans "Show more" as button_text %}
|
{% 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" %}
|
{% include 'snippets/toggle/open_button.html' with text=button_text controls_text="full" controls_uid=uuid class="is-small" %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% if not hide_more %}
|
||||||
<div id="full-{{ uuid }}" class="is-hidden">
|
<div id="full-{{ uuid }}" class="is-hidden">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div
|
<div
|
||||||
|
@ -32,6 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Reference in a new issue