forked from mirrors/bookwyrm
7dbb9b4b26
Better mobile display, trim long text blocks
34 lines
1,003 B
HTML
34 lines
1,003 B
HTML
{% spaceless %}
|
|
{% load i18n %}
|
|
{% load humanize %}
|
|
{% firstof limit 3 as limit %}
|
|
{% with subtraction_value='-'|add:limit %}
|
|
{% with remainder_count=items|length|add:subtraction_value %}
|
|
{% with remainder_count_display=remainder_count|intcomma %}
|
|
|
|
<details>
|
|
<summary>
|
|
{% for item in items|slice:limit %}
|
|
<span
|
|
{% if itemprop %}itemprop="{{ itemprop }}"{% endif %}
|
|
>{{ item }}</span>{% if not forloop.last %}, {% elif remainder_count > 0 %}, {% blocktrans trimmed count counter=remainder_count %}
|
|
and {{ remainder_count_display }} other
|
|
{% plural %}
|
|
and {{ remainder_count_display }} others
|
|
{% endblocktrans %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
</summary>
|
|
|
|
{% for item in items|slice:"3:" %}
|
|
<span
|
|
{% if itemprop %}itemprop="{{ itemprop }}"{% endif %}
|
|
>{{ item }}</span>{% if not forloop.last %}, {% endif %}
|
|
{% endfor %}
|
|
</details>
|
|
|
|
|
|
{% endwith %}
|
|
{% endwith %}
|
|
{% endwith %}
|
|
{% endspaceless %}
|