[main] add a 'read more...' on comment embeddable when overflown

This commit is contained in:
nobohan
2022-05-25 14:18:38 +02:00
parent 354c37ade2
commit 5948ac5b2a
3 changed files with 8 additions and 1 deletions

View File

@@ -9,7 +9,11 @@
#}
{{ opening_box|raw }}
{%- if options['limit_lines'] is not null -%}
{% set content = comment.comment|split('\n')|slice(0, options['limit_lines'])|join('\n') %}
{% if comment.comment|split('\n')|length > options['limit_lines'] %}
{% set content = comment.comment|split('\n')|slice(0, options['limit_lines'])|merge(['(more...)'|trans])|join('\n') %}
{% else %}
{% set content = comment.comment %}
{% endif %}
{%- else -%}
{% set content = comment.comment %}
{%- endif -%}