{% if grav.twig.enable_comments_plugin %} {% set scope = scope ?: 'data.' %} {% if grav.twig.pingbacks_enabled %} {% if grav.twig.pingbacks|length %} {% set comments_visible = false %} {% for pingback in grav.twig.pingbacks %} {% if pingback.approved == "true" %} {% set comments_visible = true %} {% endif %} {% endfor %} {% if comments_visible %}

{{'PLUGIN_COMMENTS.COMMENTS_PINGBACKS'|t}}

{% for pingback in grav.twig.pingbacks %} {% if pingback.approved == "true" %} {% endif %} {% endfor %}
{{pingback.text}}
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{pingback.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {% if pingback.site %} {{pingback.author}} {% else %} {{pingback.author}} {% endif %}
{% endif %} {% endif %} {% if grav.twig.commenting_enabled %}

{{'PLUGIN_COMMENTS.ADD_COMMENT'|t}}

{% for field in grav.config.plugins.comments.form.fields %} {% set value = form.value(field.name) %} {% if field.evaluateDefault %} {% set value = evaluate(field.evaluateDefault) %} {% endif %} {% if config.plugins.login.enabled and grav.user.authenticated %} {% if field.name == 'name' %} {% elseif field.name == 'email' %} {% else %}
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
{% endif %} {% else %}
{% include "forms/fields/#{field.type}/#{field.type}.html.twig" %}
{% endif %} {% endfor %} {% include "forms/fields/formname/formname.html.twig" %}
{% for button in grav.config.plugins.comments.form.buttons %} {% endfor %}
{{ nonce_field('form', 'form-nonce')|raw }}
{{ form.message }}
{% endif %} {% if grav.twig.comments|length %}

{{'PLUGIN_COMMENTS.COMMENTS'|t}}

{% set comments_visible = false %} {% for comment in grav.twig.comments %} {% if comment.approved == "true" %} {% set comments_visible = true %} {% endif %} {% endfor %} {% if not comments_visible %} {% endif %}
{{comment.text}}
{{'PLUGIN_COMMENTS.WRITTEN_ON'|t}} {{comment.date|e}} {{'PLUGIN_COMMENTS.BY'|t}} {% if comment.site %} {{comment.author}} {% else %} {{comment.author}} {% endif %}
{{'PLUGIN_COMMENTS.COMMENTS_NONE'|t}}
{% endif %} {% endif %}