{# Карточка поста (PostCard). Ожидает переменные post и platform_label. #} {#- Заголовок — первая строка, где есть хотя бы 4 знака (строка из одного эмодзи не годится) -#} {%- set lines = (post.content or '').strip().split('\n') | map('trim') | reject('equalto', '') | list -%} {%- set ns = namespace(idx=0) -%} {%- for l in lines %}{% if ns.idx == 0 and l|length > 3 %}{% set ns.idx = loop.index %}{% endif %}{% endfor -%} {%- set head_i = (ns.idx or 1) - 1 -%} {%- set title = (lines[head_i] if lines else 'Пост') | truncate(90, True, '…') -%} {%- set rest = lines[head_i + 1:] | join(' ') -%}
{% if post.published %} {{ ui.icon('megaphone', 14) }}Опубликован {% else %} {{ ui.icon('sparkle', 14) }}Сгенерирован ИИ {% endif %} {{ platform_label(post.platform) }}{% if post.style %} · {{ post.style | truncate(24, True, '…') }}{% endif %}

{{ title }}

{% if rest %}

{{ rest }}

{% endif %}
{{ post.created_at|local_dt }} {{ (post.content or '')|length|num }} зн. {% if post.images %}{{ ui.icon('image', 16) }}{{ post.images|length }}{% endif %} {{ ui.icon('chevron-right', 18, 'ps-card-chev') }}