{% import "post.html" as post_defs %} {% import "user.html" as user_defs %} {% macro comment_url(comment) -%} {%- if comment.post.url_slug -%} {{ '{}/{}-{}/#{}' | format(comment.domain.url, comment.post.url_slug, comment.post.id, comment.id) }} {%- else -%} {{ '{}/{}/#{}' | format(comment.domain.url, comment.post.id, comment.id) }} {%- endif %} {%- endmacro %} {% macro comment_post_url(comment) -%} {%- if comment.post.url_slug -%} {{ '{}/{}-{}/' | format(comment.domain.url, comment.post.url_slug, comment.post.id) }} {%- else -%} {{ '{}/{}/' | format(comment.domain.url, comment.post.id) }} {%- endif %} {%- endmacro %} {% macro comment_moderate_show_panel_action(comment) -%} commentControlsHandler.showPanel({button:this, {{'' }}comment_id:'{{ comment.id }}', {{'' }}user_id:'{{ comment.user.id }}', {{'' }}user_login : '{{ comment.user.login }}', {{'' }}domain: '{{ commment.domain.id }}', {{'' }}domain_prefix: '{{ commment.domain.prefix }}', {{'' }}options:[ {{'' }}'{{ 'comment_edit' if comment.can_edit else '' }}', {{'' }}'{{ 'moderate_delete_comment' if comment.can_delete else '' }}', {{'' }}'{{ 'moderate_delete_comments_branch' if comment.can_remove_comment_threads else '' }}', {{'' }}'{{ 'moderate_ban_user' if comment.can_ban else ''}}', {{'' }}'{{ 'moderate_remove_user_docs' if user.is_manager else ''}}', {{'' }}'{{ 'moderate_remove_user_activity' if comment.can_wipe else ''}}']}); {{'' }}tipsHandler.hideAllTips(); {{'' }}return false; {%- endmacro %} {% macro comment_delete_show_panel_action(comment, user) -%} commentControlsHandler.showPanel({button:this, {{'' }}comment_id:'{{ comment.id }}', {{'' }}user_id:'{{ comment.user.id }}', {{'' }}user_login : '{{ comment.user.login }}', {{'' }}options:[ 'user_ignore' ]}); {{'' }}tipsHandler.hideAllTips(); {{'' }}return false; {%- endmacro %} {% macro comment_reply_action(comment) -%} {% if not user -%} loginHandler.showLoginPopup(this, {event: event}) {%- elif comment.reply_form_available -%} commentsHandler.toggleCommentForm(this, '{{ comment.post.id }}', '{{ comment.id }}') {%- elif comment.reply_form_error and len(comment.reply_form_error) > 0 -%} commentsHandler.toggleCommentsLimitInfo($('{{ comment.id }}'), {{ self.json(comment.reply_form_error, True).replace('"', '\"') }}, this) {%- endif %} {%- endmacro %} {% macro render(comment, user, isNotification=false) -%}
{{ (comment.body | safe) if not comment.deleted else '' }}
{%- endmacro %} {% macro render_hidden_comment(comment, user) -%}
{{ _('Закрытый для вас комментарий') }}
{%- endmacro %}