{% import "user.html" as user_defs %} {% import "domain.html" as domain_defs %} {% set video_factor = 5.0 / 7.0 %} {% macro post_comments_url(post) -%} {%- if post.url_slug -%} {{ '{}/{}-{}/' | format(post.domain.url, post.url_slug, post.id) }} {%- else -%} {{ '{}/comments/{}/' | format(post.domain.url, post.id) }} {%- endif %} {%- endmacro %} {% macro post_all_comments_count_caption(post) -%} {%- if post.comments_count == 0 -%} {{ _('комментировать') }} {%- else -%} {{ post.comments_count }} {{ post.comments_count | pluralize(ngettext('комментарий', 'комментария', 0), 'комментариев')}} {%- endif -%} {%- endmacro %} {% macro post_new_comments_count_caption(post) -%} {{ post.unread_comments_count }} {{ post.comments_count | pluralize(ngettext('новый', 'новых', 0), 'новых') }} {%- endmacro %} {% macro post_all_comments_link(post, mobile = False) -%} {% if mobile -%} {%- endif %} {{ ('' | safe) if post.comments_count > 0 and post.comments_count == post.unread_comments_count else '' }} {{ post_all_comments_count_caption(post) }}{{ ('' | safe) if post.comments_count > 0 and post.comments_count == post.unread_comments_count else '' }} {%- endmacro %} {% macro post_new_comments_link(post) -%} {% if post.unread_comments_count > 0 and post.comments_count != post.unread_comments_count -%} / {{ post_new_comments_count_caption(post) }} {%- endif %} {%- endmacro %} {% macro post_domain(post, BASE_DOMAIN_ID) -%} {% if not domain and post.domain.id != BASE_DOMAIN_ID and not (post.data.type == 'inbox') and not post.advertising -%}
{%- endif %} {%- endmacro %} {% macro post_pin(post, tag_name = 'a') -%} {% if post.pinned and domain -%} <{{ tag_name }} class="b-post_pinned_icon" href="{{ post_comments_url(post) }}" title="{{ _('закреплённый пост') }}">{{ tag_name }}> {%- endif %} {%- endmacro %} {% macro post_snippet_icon(post, user) -%} {% if post.data.link.type == 'web' -%} {%- endif %} {%- endmacro %} {% macro post_estimate(post) -%} {% if post.estimate < 60 %} {{ _('меньше минуты') }} {% elif post.estimate < 3600 %} {{ (post.estimate / 60) | round(0, 'ceil') }} {{ (post.estimate / 60) | round(0, 'ceil') | pluralize(ngettext('минута', 'минуты', 0), 'минут')}} {% else %} {{ _('больше часа') }} {% endif %} — {{ _('Время на прочтение') }} {%- endmacro %} {% macro post_golden_icon_mobile(post) -%} {% if post.golden == -1 or post.golden == 1 -%} {%- endif %} {%- endmacro %} {% macro post_footer_mobile(post, user) -%}